Oracle LAST_DAY Function


/ Published in: SQL
Save to your folder(s)

A few examples of the Oracle LAST_DAY function.


Copy this code and paste it in your HTML
  1. --Example 1
  2. SELECT SYSDATE,
  3. LAST_DAY(SYSDATE) AS lastday_test
  4. FROM dual;
  5.  
  6. --Example 2
  7. SELECT LAST_DAY('10-JAN-2016') AS lastday_test
  8. FROM dual;
  9.  
  10. --Example 3
  11. SELECT SYSDATE,
  12. LAST_DAY(ADD_MONTHS(SYSDATE, 5)) AS lastday_test
  13. FROM dual;
  14.  
  15. --Example 4
  16. SELECT SYSDATE,
  17. LAST_DAY(ADD_MONTHS(SYSDATE, -1)) AS lastday_test
  18. FROM dual;

URL: http://www.databasestar.com/oracle-last_day/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.