[nycphp-talk] every other record

Chris Merlo chris at
Wed Feb 1 17:12:33 EST 2006

On 2/1/06, Craig Thomas <craig at> wrote:

> In response to some others: just because ID 4 is missing [for example]
> doesn't mean ID 5 will have a remainder of 0 when divided by 2...he'll
> still get only even IDs with this:
> select * from table where mod(id,2)=0

You're right, my bad.  But it will still return the records with IDs 2, 6,
8, 10, etc., which is not every other record.  (That would be 2, 5, 7, 9,

I'm not trying to suggest that solving this problem by getting every record
and letting PHP select every other one is more efficient; I'm merely
suggesting that it's more correct.  :)

chris at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list