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 'mysql' command line arguments? : Sql dba
What is the difference between row level and statement level trigger?
Why truncate is used in sql?
Can we use having without group by in sql?
Can we use ddl statements in stored procedure sql server?
How do I filter in sql profiler?
Which are the different character-manipulation functions in sql?
What does where 1/2 mean in sql?
How do I view tables in mysql?
Which is faster subquery or join?
Can a primary key be a foreign key?
What are the different types of tables in sql?
Is hadoop a nosql?
Why plvtab is considered as the easiest way to access the pl/sql table?
what is self-join? : Sql dba