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
What is keys and its types?
Describe types of sql statements?
What do you understand by pl/sql packages?
Is it mandatory for the primary key to be given a value when a new record is inserted?
What is the difference between execution of triggers and stored procedures?
Is sql database free?
Explain about various levels of constraint.
What is index example?
What are the different types of dbms?
What is the benefit of foreign key?
what is foreign key? : Sql dba
What does subquery mean in sql?
What are three advantages to using sql?
Can we create table in function?
What are tuples in sql?