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 is the difference between clustered and non-clustered indexes in ms sql server?

488


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

544


What are temporal tables in sql server 2016?

477


Explain what is the function of sql server agent windows service?

544


Tell me something about security and sql azure?

104






Explain trigger and trigger types?

553


What do you understand by the denormalisation?

552


How to use wildcard characters in like operations in ms sql server?

600


What is query cost in sql server?

551


What are tables in sql server?

530


What is unique key constraint?

631


How to list all schemas in a database?

578


How to get @@error and @@rowcount at the same time?

567


What is the difference between online clustering and Offline clustering?

1916


what are the Prerequisites for Replication?

10565