how to retrieve the top 2 salaried persons from a database?
Answer Posted / srinivas
select * from emp m
where
(select count(distinct sal)+1 from emp s
where s.sal>m.sal)<=2
order by sal desc
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is a constraint? Tell me about its various levels. : Sql dba
How to write a query to show the details of a student from students table whose
How many disk partitions should I have?
How to disable a trigger name update_salary?
What is equi join in sql?
What is a pragma statement?
Is primary key clustered or nonclustered?
Enlist the characteristics of pl/sql?
What is the purpose of the sql select top clause?
how to convert character strings to dates? : Sql dba
How can I see all tables in sql?
what is not null constraint? : Sql dba
what are wild cards used in database for pattern matching ? : Sql dba
Why is theta join required?
What are sql functions? Describe the different types of sql functions?