How do you select all even or odd numbers in a table?
How do you select all even or odd numbers in a table?
Topic Introduction: In this tutorial, we will show how you select all even or odd numbers in a table?
Even numbers: MOD (column name, 2) = 0
SELECT employee_idFROM EMPLOYEESWHERE MOD (employee_id, 2) = 0
Odd numbers: MOD (column name, 2) = 1
SELECT employee_idFROM EMPLOYEESWHERE MOD (employee_id, 2) = 1
No comments