August 2002
Intermediate to advanced
528 pages
10h 12m
English
The ROUND function is used to round a numeric value to a specified precision. If the value is less than 5, the function rounds down. If the value is greater than or equal to 5, the function rounds the value up. The function contains two parameters: The first is the value or column name, and the second is the precision. Listing 7.4 illustrates a query that rounds a calculated value. The first function has a precision setting of 2, which causes the value to be rounded to hundredths. The second function has a setting of –2, which causes the precision to be set at hundreds.
SQL> select last_name, wages/3, 2 round(wages/2,2), round(wages/3,-2) ... |