Oracle MOD Function


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

A few examples of the MOD function.


Copy this code and paste it in your HTML
  1. SELECT MOD(16,3) AS MOD_RESULT
  2. FROM dual;
  3.  
  4. SELECT MOD(16.5,3) AS MOD_RESULT
  5. FROM dual;
  6.  
  7. SELECT MOD(16,3.5) AS MOD_RESULT
  8. FROM dual;
  9.  
  10. SELECT MOD(16.5,3.5) AS MOD_RESULT
  11. FROM dual;
  12.  
  13. SELECT MOD(16,0) AS MOD_RESULT
  14. FROM dual;
  15.  
  16. SELECT MOD('16','3') AS MOD_RESULT
  17. FROM dual;
  18.  
  19. SELECT MOD(47,15) AS MOD_RESULT
  20. FROM dual;
  21.  
  22.  
  23.  
  24. SELECT first_name, last_name, rn
  25. FROM
  26. (
  27. SELECT first_name, last_name, rownum AS rn
  28. FROM customers
  29. ) c
  30. WHERE MOD(rn, 2) = 0;

URL: http://www.databasestar.com/oracle-mod-function-with-examples/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.