这是我对动态计算字段的查询:
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`
它工作正常,但我需要添加另一个动态字段,该字段等于rank1 rank2 … rank5.因此,我要添加另一个字段,例如
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`
它将生成错误“未知列rank1”.有趣的是,完全相同的查询可以在MS Access中正常工作.
我怎样才能解决这个问题?
谢谢!