Odd / Even rows in SQL Server

Wednesday, 8 February 2012

Odd / Even rows in SQL Server

For get even rows:

select * from table_1 where id%2=0

For get odd rows

select * from table_1 where id%2<>0


Note: Here table_1 is table name and id is autogenerated id for the column table_1.

No comments:

Post a comment