how do we find every fifth record in a table

Answer Posted / avinash

SELECT employeeID from ( Select ROW_NUMBER() OVER ( order by id )as RowNumber,employeeID FROM Employee ) as x where x.RowNumber % 5 = 0

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are alternate keys?

564


What is row_number function?

580


What is temporal data type?

513


Explain what is “asynchronous” communication in sql server service broker?

487


Explain indexed views and partitioned view with their syntax.

671






What is conditional split?

532


What are the restrictions that views have to follow?

549


How do you debug a procedure in sql server?

489


Explain insert into select statement?

514


Does server sql treat char as a variable-length or fixed-length column?

571


What is set nocount on and what is set nocount off?

506


When multiple after triggers are attached to sql table, how to control the order of execution?

519


can a table be moved to different filegroup? : Sql server administration

540


Why do we need different type of parameter?

543


Which rendering formats are affected by the pagesize properties?

106