how to find the second highest salary from emp table?
Answer Posted / susanta
select * from emp e1 where N-1 =
(select count(distinct sal)
from emp e2
where e2.sal > e1.sal)
for Nth highest salary.
| Is This Answer Correct ? | 20 Yes | 11 No |
Post New Answer View All Answers
How to look at the current sql*plus system settings?
How many times can we commit in a loop?
What is view? Can we update view
what is the different between now() and current_date()? : Sql dba
What is a rank in sql?
what is 'mysqlshow'? : Sql dba
Why function is used in sql?
what is oltp (online transaction processing)? : Sql dba
discuss about myisam index statistics collection. : Sql dba
How do I remove duplicates in two columns?
Which one is better subquery or joins?
Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?
What is a temporal table?
what are the properties and different types of sub-queries? : Sql dba
How can we debug in PL/SQL?