| Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
Functions, 38 of 121
LAST_DAY returns the date of the last day of the month that contains d. You might use this function to determine how many days are left in the current month.
SELECT SYSDATE, LAST_DAY(SYSDATE) "Last", LAST_DAY(SYSDATE) - SYSDATE "Days Left" FROM DUAL; SYSDATE Last Days Left --------- --------- ---------- 23-OCT-97 31-OCT-97 8
SELECT TO_CHAR( ADD_MONTHS( LAST_DAY(hiredate),5), 'DD-MON-YYYY') "Five months" FROM emp WHERE ename = 'MARTIN'; Five months ----------- 28-FEB-1982
|
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|