Oracleで日付関数sysdateの使い方

SQL構文

select to_char(sysdate,’YYYY/MM/DD’) FROM DUAL; — 2016/09/02
select to_char(sysdate,’YYYY’) FROM DUAL; — 2016
select to_char(sysdate,’YYY’) FROM DUAL; — 016
select to_char(sysdate,’YY’) FROM DUAL; — 16
select to_char(sysdate,’MM’) FROM DUAL; — 09
select to_char(sysdate,’DD’) FROM DUAL; — 02
select to_char(sysdate,’D’) FROM DUAL; — 6
select to_char(sysdate,’DDD’) FROM DUAL; — 246
select to_char(sysdate,’WW’) FROM DUAL; — 36
select to_char(sysdate,’W’) FROM DUAL; — 1
select to_char(sysdate,’YYYY/MM/DD HH24:MI:SS’) FROM DUAL; — 2016/09/02 13:51:09
select to_char(sysdate,’YYYY/MM/DD HH:MI:SS’) FROM DUAL; — 2016/09/02 01:51:37
select to_char(sysdate,’J’) FROM DUAL; — 2457634
select to_char(sysdate,’RR/MM/DD’) FROM DUAL; –16/09/02

Oracle

Posted by arkgame