[nycphp-talk] every other record

Rahmin Pavlovic rahmin at
Wed Feb 1 15:16:44 EST 2006

To the more knowledgeable SQL heads in the house:

Do you think it's reliable to mod() the record id to pull every other
record, like:

select * from table where mod(id,2)=0 #or
select * from table where mod(id,2)=1

Or do you think it would be more reliable to manually pull 'em, like:

select * from table limit 1,1
select * from table limit 3,1

MySQL 5.0.2

mod() appears to work, but it also seems to behave a lil wonky.

More information about the talk mailing list