这是九月份。我想要当前季度从日期和迄今为止以及过去6个季度的日期和迄今为止?
答案 0 :(得分:0)
with Nums (NN) as
(
select level - 1
from dual
connect by level <=7
)
select add_months(trunc(sysdate,'Q'), -3*NN) as startdate,
add_months(trunc(sysdate,'Q'), -3*NN +3)-1 as enddate
from Nums
答案 1 :(得分:0)
从双级连接中选择sysdate级别&lt; = to_char(sysdate,&#39; ddd&#39;) - to_char(add_months(sysdate,-6),&#39; ddd&#39;);