我想通过Apache Drill运行此查询。
select * from mytable where my_date BETWEEN sysdate-1280 AND sysdate;
答案 0 :(得分:1)
select * from mytable
where my_date BETWEEN DATE_SUB(CURRENT_TIMESTAMP, interval '1280' day(4))
AND CURRENT_TIMESTAMP;
答案 1 :(得分:0)
您可以尝试使用current_date
代替sysdate
。请在此处查看有关可用时间函数的文档:https://drill.apache.org/docs/date-time-functions-and-arithmetic/#other-date-and-time-functions