how to find nth highest salary

Answer Posted / aman kaushal

select salary from customer order by salary desc limit n,1;

here n is the array value 1st highest value starts with 0
value and then 1.

e.g

find the 2nd highest salary.

select salary from customer order by salary desc limit 1,1;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a primary key?

615


What are trace flags and mention a few common trace flags used with sql server?

639


What happens if null values are involved in boolean operations?

638


Delete duplicate rows without using rowid.

1173


What is an etl file?

620






What new data source types were added in ssrs 2014?

115


Explain primary key?

625


what is blocking? : Sql server database administration

595


Explain about link server in sql server?

624


What are the benefits of normalization?

680


What is the recovery model?

647


what are the types of indexes? : Sql server database administration

671


What is data mart? : sql server analysis services, ssas

690


What is the minimum recommended amount of ram for sql server 2012 enterprise?

599


How can we solve concurrency problems?

674