how to get second highest salary in SQL(as/4000

Answer Posted / raji_4u

select *
from emp e1
where 2 = ( select count(distinct sal)
from emp e2
where e1.sal <= e2.sal
)

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does truncate need commit?

699


What is a procedure in pl sql?

783


Does sql use python?

756


What is the difference between drop and truncate commands?

704


What is blind sql injection?

757






What is anonymous block in sql?

824


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

1079


What is the difference between inner join and outer join?

712


What is record variable?

708


How do you get column names only for a table (sql server)?

860


What is thread join () in threading?

735


What is an alias command?

764


what is rollback? : Sql dba

757


What is the usage of nvl function?

770


What is materialized view. What are different methods of refresh?

1068