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

Answer Posted / c srirammulu

select * from emp a where &n=(select count(distinct (sal))
from emp f where a.sal<f.sal)

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to pass parameters to triggers?

777


What is primary key secondary key alternate key candidate key?

765


Why indexing is needed?

730


What is the trigger in sql?

700


What is a table in a database?

786






Explain unique key in sql.

738


Which is faster joins or subqueries?

717


What are the ways on commenting in a pl/sql code?

676


How subquery works in sql?

727


what is a composite primary key ? : Sql dba

782


What is self-join and what is the requirement of self-join?

843


What is the purpose of a secondary key?

681


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2189


What is %rowtype in pl sql?

694


What is an inconsistent dependency?

761