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

On a windows server 2003 active – passive failover cluster, how do you find the node which is active?

624


List the different types of collation sensitivities in sql server?

508


What are the differences between char and nchar in ms sql server?

515


What is stretch database in sql server?

541


Explain the difference between functions and stored procedures in sql server?

457






What are the advantages of partitioning?

617


What do you understand by coalesce in sql server?

474


What are the different types of Indexes available in SQL Server?

497


How many types of local tables are there in sql server?

489


How many null values we can have in a unique key field in sql server?

532


How to optimize stored procedure optimization?

498


Explain the steps to use transact-sql cursor?

504


Do you know what is lock escalation?

555


How many replicas are maintained for each sql azure db?

102


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

501