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
Could you please provide oca (oracle 10g) dumps for my certification ?
Do stored procedures prevent sql injection?
What is left join example?
What is nested table in pl sql?
What does varchar include?
Which command is used to delete a package?
what are date and time intervals? : Sql dba
What language is oracle sql developer?
What is the use of prepared statement?
Is join and inner join the same?
What are all the different normalizations?
List the various privileges that a user can grant to another user?
How insert into statements in sql?
How to use sql statements in pl/sql?
What is the maximum number of triggers, you can apply on a single table?