Oracle gets the function method of which day, week, month, quarter, and year of a certain day of the year

1. What day of the year is

select to_char(sysdate,'yyyy-MM-dd') from dual;

2. Which week is the day of the year

select to_char(sysdate,'iw') from dual;

3. Which month is a certain day of the year

select to_char(sysdate,'mm') from dual;

4. Which quarter is a certain day of the year

select to_char(sysdate,'q') from dual;

5. What year is a certain day of the year

select to_char(sysdate,'yyyy') from dual;

Guess you like

Origin blog.csdn.net/LOVE_Me__/article/details/104960991