Previous |
Next |
Numeric functions accept numeric input and return numeric values. Each numeric function returns a single value for each row that is evaluated. The numeric functions that SQL supports are listed and described in Oracle Database SQL Language Reference.
The query in the following example uses the numeric function ROUND
to display the daily pay of each employee in department 100, rounded to the nearest cent.
Rounding Numeric Data
SELECT LAST_NAME,
ROUND (((SALARY * 12)/365), 2) "Daily Pay"
FROM EMPLOYEES
WHERE DEPARTMENT_ID = 100
ORDER BY LAST_NAME;
Result:
LAST_NAME Daily Pay ------------------------- ---------- Chen 269.59 Faviet 295.89 Greenberg 394.52 Popp 226.85 Sciarra 253.15 Urman 256.44 6 rows selected.
The query in the following example uses the numeric function TRUNC
to display the daily pay of each employee in department 100, truncated to the nearest dollar.