Search before asking
Version
版本:V2.0.8
系统 Windows 11
Describe the bug and provide the minimal reproduce step
当执行如下SQL时,对于DIFF展示的结果无异议:
select "time" ,
symbol ,
display_name ,
close_hfq ,
ma_3 ,
DIFF(ma_3 ) as "MA_3 斜率",
ATAN(DIFF(ma_3 )) as "MA_3 弧度角"
FROM
quant.stock_kline_monthly
where symbol = '600000'
ORDER by "time";
但是我需要查看最近数据的情况,所以需要 Order By time DESC;
这时候我在外面再包一层select
SELECT * FROM (
select "time" ,
symbol ,
display_name ,
close_hfq ,
ma_3 ,
DIFF(ma_3 ) as "MA_3 斜率",
ATAN(DIFF(ma_3 )) as "MA_3 弧度角"
FROM
quant.stock_kline_monthly
where symbol = '600000'
ORDER by "time"
)
ORDER by "time" DESC;
这时候得到的结果如下,发现DIFF依然是在最外层Select的基础上处理的,这样不符合SQL中的逻辑:
What did you expect to see?
期待为Diff 只在属于它那一层的结果集上做处理,而不是在最终结果级上(或可能其他原因);
这样可以得到从后向前的diff测点值并,在外层查看到最新值的数据
What did you see instead?
在外层包了一层select 倒序排序后,第一行任然没有diff数据
Anything else?
No response
Are you willing to submit a PR?
Search before asking
Version
版本:V2.0.8
系统 Windows 11
Describe the bug and provide the minimal reproduce step
当执行如下SQL时,对于DIFF展示的结果无异议:
但是我需要查看最近数据的情况,所以需要 Order By time DESC;
这时候我在外面再包一层select
这时候得到的结果如下,发现DIFF依然是在最外层Select的基础上处理的,这样不符合SQL中的逻辑:
What did you expect to see?
期待为Diff 只在属于它那一层的结果集上做处理,而不是在最终结果级上(或可能其他原因);
这样可以得到从后向前的diff测点值并,在外层查看到最新值的数据
What did you see instead?
在外层包了一层select 倒序排序后,第一行任然没有diff数据
Anything else?
No response
Are you willing to submit a PR?