ok Posted August 15, 2008 Share Posted August 15, 2008 ok let say i have 10 records and it has auto increment id. now i want to select only the odd numbers of the id? example: id: 1, 3, 5, 7, 9 how can i do this using SELECT? thank you in advance. Link to comment https://forums.phpfreaks.com/topic/119802-selecting-the-odd-number-id-only-of-the-records-very-easy/ Share on other sites More sharing options...
JasonLewis Posted August 15, 2008 Share Posted August 15, 2008 Well, not sure if there is a better way. But you can do this: SELECT * FROM tablename WHERE id%2=1 Then instead of 1 have 0 for even. Link to comment https://forums.phpfreaks.com/topic/119802-selecting-the-odd-number-id-only-of-the-records-very-easy/#findComment-617195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.