How to retrieve 3rd Max salary from a table in sql server?Tagged: sql server, Sql Server 2008This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by Ritesh.Viewing 3 posts - 1 through 3 (of 3 total)AuthorPosts November 19, 2015 at 12:13 pm #5150 PavanMemberI am facing problem when i m fetching data from data base then i need to 3rd max salary and some times condition changed then we need to fetch nth number salary.I want a generalized query. November 19, 2015 at 12:18 pm #5151 Hirendra SisodiyaKeymasterSimple use sql query like as:SELECT TOP 1 Empsalary FROM ( SELECT DISTINCT TOP 3 Empsalary FROM tblemployee ORDER BY Empsalary DESC) a ORDER BY EmpsalaryYou can get nth highest number or salary from the above query. November 19, 2015 at 12:26 pm #5153 RiteshMemberyou can also use Sql rank() function like :select Empname,Empsalary from ( select Empname,Empsalary,rank() over (order by Empsalary desc) as ranking from tblemployee ) a where ranking = 3hope this helps…. AuthorPosts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic.Log In Username: Password: Keep me signed inLog In