Overblog Follow this blog
Edit post Administration Create my blog
Balavardhan Reddy Narani

Find nth maximum salary from the table

March 7 2009 , Written by Balavardhan Published on #SQL Server2005

Nth Maximum salary from the Table

Table structure
Name : Employee
Columns : Empid, Empname, Salary

Query to find nth max salary from the Employee table

Declare @n Int

Select * from Employee where @n-1
(select count(distinct(salary)) from employee e where employee.salary < e.salary)

Share this post

Repost 0

Comment on this post