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 are the operators used in select statements?
What is a unique key?
What is normalization in a database?
What is sql data?
Does execute immediate commit?
What is string data type in sql?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
what is timestamp in mysql? : Sql dba
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
What are reports usually used for?
What are the benefits of triggers?
What is meant by cursor in sql?
What are the usages of sql?
Does truncate table reset auto increment?
what is the stuff function and how does it differ from the replace function? : Sql dba