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 are sql built in functions?
What are all ddl commands?
Is delete faster than truncate?
What is consistency?
what is meant by nl2br()? : Sql dba
How many scalar data types are supported in pl/sql?
Is a table valued function object?
how can we optimize or increase the speed of a mysql select query? : Sql dba
What do you understand by case manipulation functions?
what is the command used to fetch first 5 characters of the string? : Sql dba
What is meant by truncate in sql?
what are the differences among rownum, rank and dense_rank? : Sql dba
What are the 3 modes of parameter?
What are sql objects?
What is sql entity?