how to check the 3rd max salary from an employee table?
Answer Posted / a.brahmam
select * from(select rownum r,sal from(select * from table name order by sal desc))
where r=3;
(or)
select * from(select rownum,sal from table name order by sal desc)
where rownum<=3
minus
select * from(select rownum,sal from table name order by sal desc)
where rownum<=2
(or)
select * from(select sal,dense_rank()over(order by sal desc)r from table name)
where r=3
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I count duplicates in sql?
What is crud stand for?
what is rdbms? : Sql dba
What are different categories of sql commands?
How many sql statements are used? Define them.
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
Explain alias in sql?
What is varchar data type in sql?
What are the triggers associated with image items?
what is oltp (online transaction processing)? : Sql dba
How exception handling is done in advance pl/sql?
How do I install sql?
What is the basic structure of an sql?
How global cursor can be declare with dynamic trigger ?
What are the advantages of pl sql over sql?