Write a query to find second highest salary of an employee.

Answer Posted / om patel

select (distinct(a.sal) from emp e where rownum=&N(select
count(distinct(b.sal)) from emp b where a.sal<=b.sal)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the repeatable read and serializable isolation levels? : Transact sql

536


What is bitemporal narrowing?

739


What is trigger point?

539


Does sql between include endpoints?

554


What are the different type of joins in sql?

544






What is Materialized View? In What Scenario we Use Materialized View?

8528


What is join view in sql?

515


What is blind sql injection?

578


Is oracle and sql same?

575


what are the types of join and explain each? : Sql dba

533


what are wild cards used in database for pattern matching ? : Sql dba

551


what is “go” in t-sql? : Transact sql

603


What are the limitations of sql express?

530


Why triggers are used?

557


Why is a primary key important?

547