Why `the sql may be wrong` error appeared when adding `order by` to query statement in Apache IoTDB?

38 Views Asked by At

What may cause the sql may be wrong error when adding order by to the Apache IoTDB query? My query statement is

select CY1, CY3 
from root.*.line_id.17.machine.id.1715 
where timestamp<1660268809952 order by timestamp limit 1 

How should I correct my statement?

1

There are 1 best solutions below

0
On BEST ANSWER

Try order by time desc instead of order by timestamp. You can also directly use order by time grammar in Apache IoTDB for other time-related scenarios.