Friday, 6 March 2015

Truncate function in sql

1. Get the last day of the month.

sql> SELECT TRUNC (LAST_DAY (SYSDATE)) "Last day of current month"
    FROM DUAL;


2.  Get the first day of the Year

sql> SELECT TRUNC (SYSDATE, 'YEAR') "Year First Day" FROM DUAL;

Share this

0 Comment to "Truncate function in sql"

Post a Comment