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 operating systems are supported by oracle sql developer?
What are sql functions? Describe the different types of sql functions?
What is pl sql and why it is used for?
what is oltp (online transaction processing)? : Sql dba
Is sql developer case sensitive?
Why schema is used in sql?
Why query optimization is needed?
Can we use ddl statements in stored procedure?
How do you optimize a stored procedure query?
What is snowflake sql?
Why cross join is used?
what is the difference between nested subquery and correlated subquery?
what is top in tsql? : Transact sql
What are secondary keys?
What are tables and fields?