這是我的動態計算領域的查詢:總和MySQL查詢動態生成的字段
SELECT 5 * (`Mean (all)` +0.01735568)/(0.07268901) AS rank1,
5 * (`CVaR 95` +0.51612)/(0.53212) AS rank2,
5 * (`Hurst` - 0.2)/(0.7717653) AS rank3,
5 * (`MaxDD` +6.200000762939453)/(16.200000762939) AS rank4,
5 * (`Positive % 12` - 0.3)/(1) AS rank5
FROM `quant1`
它工作正常,但我需要添加另一個動態場等於秩1 +秩2 ... +因此,我添加了另一個字段,如
SELECT 5 * (`Mean (all)` +0.01735568)/(0.07268901) AS rank1,
5 * (`CVaR 95` +0.51612)/(0.53212) AS rank2,
5 * (`Hurst` - 0.2)/(0.7717653) AS rank3,
5 * (`MaxDD` +6.200000762939453)/(16.200000762939) AS rank4,
5 * (`Positive % 12` - 0.3)/(1) AS rank5,
rank1+rank2+rank3+rank4+rank5 AS rank
FROM `quant1`
它會生成一個錯誤「unknown column rank1」。有趣的是,完全相同的查詢適用於MS Access。
我該如何解決這個問題?
謝謝!
它的最佳執行時間爲0.049秒。 – user2723490