/ Published in: SQL
A few examples of the MOD function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT MOD(16,3) AS MOD_RESULT FROM dual; SELECT MOD(16.5,3) AS MOD_RESULT FROM dual; SELECT MOD(16,3.5) AS MOD_RESULT FROM dual; SELECT MOD(16.5,3.5) AS MOD_RESULT FROM dual; SELECT MOD(16,0) AS MOD_RESULT FROM dual; SELECT MOD('16','3') AS MOD_RESULT FROM dual; SELECT MOD(47,15) AS MOD_RESULT FROM dual; SELECT first_name, last_name, rn FROM ( SELECT first_name, last_name, rownum AS rn FROM customers ) c WHERE MOD(rn, 2) = 0;
URL: http://www.databasestar.com/oracle-mod-function-with-examples/