Oracle ROUND Function


/ Published in: SQL
Save to your folder(s)

A few examples of the Oracle ROUND function.


Copy this code and paste it in your HTML
  1. --Example 1
  2.  
  3. SELECT ROUND(3162.845, 1) AS ROUNDED
  4. FROM dual;
  5.  
  6. --Example 2
  7. SELECT ROUND(3162.8451297, 5) AS ROUNDED
  8. FROM dual;
  9.  
  10. --Example 3
  11. SELECT ROUND(3162.845, -2) AS ROUNDED
  12. FROM dual;
  13.  
  14. --Example 4
  15. SELECT ROUND(142786, -3) AS ROUNDED
  16. FROM dual;
  17.  
  18. --Example 5
  19. SELECT ROUND(3162.845, 0) AS ROUNDED
  20. FROM dual;
  21.  
  22. --Example 6
  23. SELECT ROUND(3162.845) AS ROUNDED
  24. FROM dual;
  25.  
  26. --Example 7
  27. SELECT ROUND(3162.845/5)*5 AS ROUNDED
  28. FROM dual;
  29.  
  30.  
  31.  
  32.  
  33.  
  34. --Example 8
  35. SELECT ROUND(142786, -2) AS ROUNDED
  36. FROM dual;
  37.  
  38. --Example 9
  39. SELECT SYSDATE, ROUND(SYSDATE, 'YEAR') AS ROUNDED
  40. FROM dual;
  41.  
  42. --Example 10
  43. SELECT SYSDATE, ROUND(SYSDATE, 'MONTH') AS ROUNDED
  44. FROM dual;

URL: http://www.databasestar.com/oracle-round/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.