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 database white box testing and black box testing?
Which are the different case manipulation functions in sql?
What are commit, rollback, and savepoint?
what is the difference between char_length and length? : Sql dba
What are types of exception?
how do you login to mysql using unix shell? : Sql dba
How do you drop a trigger?
What are sql functions? Describe in brief different types of sql functions?
How are functions and procedures called in PL/SQL?
How does postgresql compare to oracle/db2/ms sql server/informix?
what are the non-standard sql commands supported by 'mysql'? : Sql dba
How is sql used in oracle?
Where do we use pl sql?
Is microsoft sql free?
What are the key differences between SQL and PL SQL?