To Find nth value in SQL SERVER

Here I will going to give you a quick Query to find the nth row from table in SQL SERVER.
  1. select * from  (select *,dense_rank() over(order by amount desc)rank from dattahaltingdetails)as tab where tab.rank=5  
So, what is dense_rank() ?
 
DENSE_RANK gives you the ranking within consecutive ordered partition, No ranks are skipped if there are ranks with multiple items. It will gives same rank for duplicate column value.
Ebook Download
View all
Learn
View all