By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,601 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,601 IT Pros & Developers. It's quick & easy.

How to select odd and even numbers in mysql

P: 1
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/.

Odd number select...

select column_name from table_name where mod(column_name,2)=1;
Even number select..

select column_name from table_name where mod(column_name,2)=0;
if u need odd or even number put 1 or 0.
Jun 14 '14 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,035
you posted this in 'Questions', should it not be in 'Articles'
Jun 14 '14 #2

P: 30

Post your reply

Sign in to post your reply or Sign up for a free account.