how to write the query to select the rows are in the order
of either 1,3,5,7... or 2,4,6,8,...

Answer Posted / md. niyaz

For: 2, 4, 6, ......

select * from <Table_Name> where <Column_Name> % 2 = 0

==============Niyaz====================================

For: 1, 3, 5, ......

select * from <Table_Name> where <Column_Name> % 2 = 1

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List the data types available in mssql?

516


What are the limitations in ssrs on sql server express edition?

137


Can you explain the disadvantages/limitation of the cursor?

499


What are group functions in query statements in ms sql server?

545


Why does sql studio use a single registered database repository? : sql server management studio

521






What do you understand by integration services in sql server?

541


What are the disadvantages of using querystrings to send data from one page to another?

578


How to view the error log for any specific instance? : sql server database administration

577


How to use "if ... Else if ... Else ..." Statement structures in ms sql server?

531


What is triggers and stored procedures?

512


How to insert multiple rows with a subquery?

528


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1298


How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

551


What is 1nf 2nf and 3nf?

487


What is apply operator in sql?

557