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 / leo

with contactinfo as (
select contactid,firstname,row_number() over (order by
firstname)as row from person.contact
)
--select * from contactinfo where row % 2 =0

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Ways to improve the performance of a SQL Azure Database?

103


What stored by the master?

541


What are the pre-defined functions in the sql server?

515


How ssrs maintain security?

572


What are the differences between stored procedure and view in sql server?

616






Why variables called the most powerful component of ssis?

587


Explain four layers of abstraction microsoft architectured?

120


What is compound operators?

544


What is the language structure to add a record to a table?

571


Are semicolons required at the end of sql statements in sql server 2005?

565


What is a data collection table?

536


Why is replication required on the sql server?

571


What is join and name different type of joins?

573


What are the different types of stored procedures?

544


What is table join?

597