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
Explain ttitle and btitle.
How to run sql commands in sql*plus?
What are the two characteristics of a primary key?
What is varchar sql?
What are dml commands?
Is like operator in sql case sensitive?
What is the purpose of my sql?
what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba
How to add new employee details in an employee_details table with the following details
What is before trigger?
What are the advantages of sql?
What is the advantage of index in sql?
Which language is used in sql?
What are triggers and its uses?
How do you optimize a stored procedure in sql?