Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Date Timestamp Functions
 

ROUND(x[, unit])

If you supply an optional unit string, x is rounded to that unit; In the following example, YYYY rounds x to the first day of the nearest year. SQL> SQL> SELECT ROUND(TO_DATE('25-OCT-2005'), 'YYYY') FROM dual; ROUND(TO_ --------- 01-JAN-06