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
Why having clause is used in sql?
Can you do multiple joins in sql?
What is difference between group by and partition by?
Can there be 2 primary keys in a table?
What is sqlcontext?
how to use in conditions? : Sql dba
How many functions are there in sql?
how to get a list of all tables in a database? : Sql dba
How many types of tables are there?
How to call a javascript function from pl sql?
what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba
what is datawarehouse? : Sql dba
what is data control language? : Sql dba
How do I create an index in word?
What is the starting oracle error number? What is meant by forward declaration in functions?