how do we find every fifth record in a table
Answer Posted / saurabh tyagi
select id ,partcode from prt where id in
(
select case when row_number() over (order by partcode ) %
5 = 0
then row_number() over (order by
partcode)
else 0 end
from prt
)
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain optimistic and pessimistic concurrency?
Why do we use stored procedures in sql server?
What are sql azure firewall rules?
What are the basic functions for master, msdb, model, tempdb databases?
What is the status of services on passive node for failover cluster in sql server? : sql server database administration
What does executeupdate return?
What is the difference between system objects and user objects?
What is an expensive query?
How to get the number of affected rows?
How to get a list of columns using the "sys.columns" view in ms sql server?
What is a database in ms sql server?
How to use go command in "sqlcmd"?
Your company has 50 branches all over the country all the branches, including the head office have sql server as the database every night all 50 branches upload certain information to the head office which replication topology is best suited for the above scenario?
What is the guest user account in sql server? What login is it mapped to it? : sql server security
How to disable a login name in ms sql server?