René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

round [Oracle SQL]

Numbers

round(n)
round(n, precision)
select round( 7.7777),
       round( 7.7777, 3),
       round( 3.3333, 2),
       round(-3.3333, 2),
       round(-7.7777, 1)
  from dual;
ROUND(7.7777) ROUND(7.7777,3) ROUND(3.3333,2) ROUND(-3.3333,2) ROUND(-7.7777,1)
------------- --------------- --------------- ---------------- ----------------
            8           7.778            3.33            -3.33             -7.8

Dates

round(d)
round(d, 'format-string')
select round(date '2006-04-03'),
       round(date '2006-04-03', 'month'),
       round(date '2006-04-03', 'year')
  from dual;
ROUND(DAT ROUND(DAT ROUND(DAT
--------- --------- ---------
03-APR-06 01-APR-06 01-JAN-06

Links

See also trunc