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
How do I quit sql?
Is pl sql useful?
What is rename in sql?
what is top in tsql? : Transact sql
What is oracle sql called?
What is cold data?
how to add a new column to an existing table in mysql? : Sql dba
What is primary key and unique key?
what is a composite key ? : Sql dba
What does trigger mean in psychology?
What is the use of index in sql?
What is posting?
What are the packages in pl sql?
How do I debug a stored procedure?
How can one get sql*loader to commit only at the end of the load file? : aql loader