How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / rajat

SELECT * FROM (
SELECT RANK()OVER( ORDER BY SALARY DESC) NUM, A.* FROM RAJ A)
WHERE NUM=2;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is data control language? : Sql dba

580


What is offset in sql query?

589


How do I order columns in sql?

522


How does sql profiler work?

563


What are the parameter modes supported by pl/sql?

526






Explain spool.

679


What is the difference between partition and index?

476


What is the difference between inner join and natural join?

501


define sql update statement ? : Sql dba

561


What is the process of copying data from table a to table b?

588


Why do we use cursors?

503


what is the difference difference between procedure and packages

9198


What is difference between mysql and postgresql?

506


What is java sql connection?

506


What is procedure explain with program?

546