How to select all even id's from a Table?
To select even or odd IDs from a MySQL table, you would use the modulo operator (like in PHP):
SELECT * FROM table WHERE (id % 2) = 0; # even
SELECT * FROM table WHERE (id % 2) > 0; # odd
In order to select even or odd IDs from a MySQL table, you would use the 'MOD', this easy way to select the Odd and Even numbers.
Select Odd number
select column_name from table_name where mod(column_name,2)=1;
Select Even number
select column_name from table_name where mod(column_name,2)=0;
if you need an Odd number, put 1.
if you need an Even number, put 0.