how do we find every fifth record in a table

Answer Posted / krishans

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

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the maximum row of a size?

570


Explain the phases a transaction has to undergo?

554


How do you drop an index?

500


What is rs.exe utility?

118


When you should use a low fill factor?

518






Why should we go for stored procedures? Why not direct queries?

572


Is it possible to replicate data from sql server to oracle? : sql server replication

543


What is difference between group by and having?

560


What are the different types of triggers in SQL SERVER?

537


How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?

580


What is the cartesian product of table?

542


What are the system database in sql server 2008?

571


Write down the syntax and an example for create, rename and delete index?

530


Explain how dts is used to extract, transform and consolidate data?

578


When is update_statistics command used?

581