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 procedure in pl sql?
What is the size of partition table?
Why trigger is used in sql?
How do I view output in sql developer?
How is data stored on a disk?
How can we solve sql error: ora-00904: invalid identifier?
How exception is different from error?
What is oracle and pl sql?
What are triggers and its types?
What is difference between function and trigger?
how can we know the number of days between two given dates using mysql? : Sql dba
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
How to select unique records from a table?
Can we update views in sql?
How to execute a stored procedure?