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
what is data control language? : Sql dba
What is offset in sql query?
How do I order columns in sql?
How does sql profiler work?
What are the parameter modes supported by pl/sql?
Explain spool.
What is the difference between partition and index?
What is the difference between inner join and natural join?
define sql update statement ? : Sql dba
What is the process of copying data from table a to table b?
Why do we use cursors?
what is the difference difference between procedure and packages
What is difference between mysql and postgresql?
What is java sql connection?
What is procedure explain with program?