It depends on what type of data you are having if you have auto increment field in it then you might have unique number and you can find the query using php script
This can only be done if you have a numerical field in your database upon which you are using to determine if a record is odd/even. Let's call this 'FieldN'. The below will be the WHERE clause of your query and will return only those records where that number is odd: 'WHERE MOD([FieldN],2)=1' For more info about the MOD function you can go to this link: http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_mod
If you want odd rows, it's actually just a little faster to use a bitwise AND than it is to use MOD. SELECT * FROM `table` WHERE id & 1; Code (markup): On a table with 2 million rows, it takes 1.43 seconds to count all of the odd rows with the AND operator. Whereas with the MOD function it takes 1.63 seconds to count them. Using the modulo operator (WHERE id % 2) is just a little faster than the MOD function, but still slower than the bitwise AND.