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 a trigger word?
What is the default isolation level in sql server? : Transact sql
What are the most important ddl statements in sql?
how to run 'mysql' commands from a batch file? : Sql dba
What are few of the schema objects that are created using PL/SQL?
Mention what does plv msg allows you to do?
what is denormalization. : Sql dba
Explain exception handling in pl/sql?
Is ms sql traffic encrypted?
How can we implement rollback or commit statement in a trigger?
How do you bind variables in pl sql?
what is data integrity? : Sql dba
Are there any features that are decommissioned in 11g that are not present in 11g?
What is difference between inner join and cross join?
What sql database should I use?