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
Which is faster view or stored procedure?
How run sql*plus commands that are stored in a local file?
What is partition by in sql?
Is it possible to read/write files to-and-from PL/SQL?
What's the procedure?
What are triggers and its uses?
Explain character-manipulation functions?
What is sql and its types?
How do you delete a table?
Explain mutating table error.
State some properties of relational databases?
What are the different dcl commands in sql?
What does the acronym acid stand for in database management?
How can you select unique records from a table?
Does pl/sql support create command?