i have a table MEN in sql server 2008 that contain 150 rows.
how i can show only the even or only the odd rows ?
thank's in advance
i have a table MEN in sql server 2008 that contain 150 rows.
how i can show only the even or only the odd rows ?
thank's in advance
Try this :
odd :
even :
To select an odd id from a table:
To select an even id from a table:
Following is for fetching even number:: Select * from MEN where Men_ID%2=0;
Following is for fetching odd number:: Select * from MEN where Men_ID%2!=0;
Here MEN is your table_name Men_ID is the column in MEN Table.
FASTER: Bitwise instead of modulus.
Random question: Do you actually use uppercase table names? Usually uppercase is reserved for keywords. (By convention)