/ Published in: SQL
A few examples of the Oracle CURRENT_DATE function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
--CURRENT_DATE SELECT CURRENT_DATE, SYSDATE FROM dual; SELECT TO_CHAR(CURRENT_DATE, 'DD-MON-YY HH:MI:SS') AS CDATE, TO_CHAR(SYSDATE, 'DD-MON-YY HH:MI:SS') AS SDATE FROM dual; SELECT CURRENT_DATE, TRUNC(CURRENT_DATE) AS trunc_today, TRUNC(CURRENT_DATE)-1 AS trunc_yesterday FROM dual; --Example 1 SELECT CURRENT_DATE FROM dual; --Example 2 SELECT TO_CHAR(CURRENT_DATE, 'DD-MON-YY HH:MI:SS') AS CDATE FROM dual;
URL: http://www.databasestar.com/oracle-current_date/