oracle 获取当前季

阅读 58

2022-06-30

方法1:
SELECT
CASE WHEN to_number(to_char(sysdate,'mm'),99) <4 then '春季'
when to_number(to_char(sysdate,'mm'),99) between 4 and 6 then '夏季'
when to_number(to_char(sysdate,'mm'),99) between 7 and 9 then '秋季'
ELSE '冬季' END CASE
from dual

方法2:
select trunc(sysdate,'q') from dual

精彩评论(0)

0 0 举报