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 are the ddl commands?
what are the features and advantages of object-oriented programming? : Sql dba
how to get @@error and @@rowcount at the same time? : Sql dba
What are different types of tables in sql?
Is postgresql a server?
What is an exception in pl/sql?
How does left join work in sql?
How does stored procedure reduce network traffic?
can sql servers linked to other servers like oracle? : Sql dba
Why is sql better than hql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
What is difference between function and trigger?
what is a unique key ? : Sql dba
Explain select statements in sql?
What are the types of functions in sql?