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
Sql technical questions
what is the different between now() and current_date()? : Sql dba
Explain polymorphism in pl/sql.
What is the best partition size for windows 10?
what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba
How can I change database name in sql?
What is on delete set null?
Does sap use sql?
What is foreign key in sql with example?
what is rdbms? : Sql dba
What is the difference between sql and t sql?
Explain the components of sql?
What is java sql connection?
Explain what is dbms?
How do you update a value in sql?