我要取过去四个季度包括本季度的数据。
假设我在30-MAR-2019上运行查询,那么我希望数据从01-APR-201831-MAR-2019
如果我在01-apr-2019上运行查询,那么我需要01-JUL-201830-JUN-2019之间的数据
你能帮我一下吗

最佳答案

你可以:

select (trunc(sysdate, 'Q') + interval '3' month) as next_quarter_start,
       (trunc(sysdate, 'Q') + interval '15' month) - interval '1' day as next_quarter_end
from dual;

关于sql - 最近四季度的数据,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55705927/

10-12 17:32
查看更多