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
What are exact numeric data types in ms sql server?
What does it mean to invest in the index?
What do you understand by sql server agent?
Relational calculus is what type of language?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
Difference between Inner vs outer joins?
Do you know what guidelines should be followed to help minimize deadlocks?
What is difference between clustered and non clustered index?
How extra digits are handled with numeric data type literals?
How to change server name in sql server?
How much is a sql server license?
What is wrong with sql server client libarary dll, ntwdblib.dll?
What are the properties of sub-query?
Why do we use non clustered index?
How to insert stored procedure result into temporary table?