How to get nth rows from table
please tell me how to get nth rows from table in sql server 2008
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sibeesh VenuRank #27 · 42.9K reputationPosted Jun 29, 2015, 3:50 AM EDT
SELECT * FROM ( SELECT ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber, columns FROM tablename ) AS foo WHERE rownumber nSibeesh VenuRank #27 · 42.9K reputationPosted Jun 29, 2015, 4:13 AM EDT
Nilesh JadavRank #109 · 20.3K reputationPosted Jun 29, 2015, 4:18 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 29, 2015, 4:31 AM EDT
select * from( select id,name,row_number() over(order by id) as 'row' from student)as temp where row=nManoj BhoirRank #599 · 4K reputationPosted Jun 29, 2015, 4:54 AM EDT
SELECT (ROW_NUMBER() OVER (ORDER BY TableColumnName)) as row,*
FROM TableName)
SELECT * FROM myTableWithRows WHERE row = 3