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 / sreeharibabu
SELECT id
FROM (select salary2.*, rownum rnum from
(select * from test ORDER BY id DESC) salary2
where rownum <=2 )
WHERE rnum >= 2;
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is meant by temporal data?
What are sql procedures?
What is the difference between a database and a relational database?
How to take user input in pl sql?
What is restrict in sql?
What is the process of copying data from table a to table b?
Is oracle sql free?
What does where 1/2 mean in sql?
How does postgresql compare to mysql?
Is sql harder than python?
What is composite primary key in sql?
Why is sql important?
How do I run a pl sql program?
What is a ddl command?
What is the difference between syntax error and runtime error?