how to find the second highest salary from emp table?

Answer Posted / sankar sasmal

select distinct sal from emp e where 2=(select count(distinct sal)from emp s where e.sal<=s.sal)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which operator is used in query for pattern matching?

629


What is break?

620


How do I truncate a word?

529


Can you selectively load only those records that you need? : aql loader

615


How does an execution block start and end in pl sql?

502






Can there be more than one function with a similar name in a pl/sql block?

550


What are the benefits of pl sql?

530


How does stored procedure reduce network traffic?

548


How to display the current date in sql?

602


What are expressions?

564


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3109


What is the use of index in hive?

549


how can we submit a form without a submit button? : Sql dba

540


What is the difference between inner join and left join?

550


What is bind reference and how can it be created?

582