Thursday, November 19, 2009

How to get nth highest value from a table

SELECT t.*
FROM (
SELECT *,row_number() over (ORDER BY AccountNo desc) as _Rank
FROM AccountInformation
)as t
where t._Rank=2

No comments: