2012年4月12日星期四

How To Retreive Date and Time Information In Oracle


How To Retreive Date and Time Information In Oracle

SQL> select to_char(sysdate,'DD/MM/YYYY HH24:MI') "Started" from dual;

Started
----------------
30/12/2009 16:54

SQL> select sysdate from dual;

SYSDATE
---------
30-DEC-09

SQL> select sysdate-1 from dual;

SYSDATE-1
---------
29-DEC-09

SQL> select trunc(sysdate-1) from dual;

TRUNC(SYS
---------
29-DEC-09

SQL> select '29-DEC-09' from dual;

'29-DEC-0
---------
29-DEC-09

沒有留言: