How to find only %th Highest Sal

Answer Posted / sujitpingale

Ans: select distinct(a.salary) from customers a where &n =
(select count(distinct(b.salary)) from customers b where
a.salary <= b.salary);

Enter value in inputbox. If you enter 1 then it will give
highest salary

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

760


what is sp_pkeys? : Transact sql

889


What does rownum mean in sql?

722


How is sql used in oracle?

756


What is %type in sql?

691






Why join is faster than subquery?

792


What is bulk compiling in pl/sql.?

798


Which join condition can be specified using on clause?

702


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

711


Explain the the delete statements in sql?

756


What is optimistic concurrency control? : Transact sql

746


How to avoid duplicate records in a query?

749


What is natural join in sql?

710


How do you modify a trigger?

695


how to check server status with 'mysqladmin'? : Sql dba

784