因为 where 先于 order by 执行,所以您这样直接查询,可能不符合您的预期,正确的操作是先 order by 进行排序,然后对排序后的结果进行 where 过滤。
select * from loadTable("dfs://mydb", "bond_1m") where bondcode='113566.SH' and preClose!=prev(close) order by datetime
为什么我已经修改了错误的 prevClose 按照此语句查询,仍然有异常结果:
因为 where 先于 order by 执行,所以您这样直接查询,可能不符合您的预期,正确的操作是先 order by 进行排序,然后对排序后的结果进行 where 过滤。