i need department wise top 2 employees salary.which logic
i will use
Answer Posted / manish gupta
select deptno,sal from (select * from emp order by sal
desc) where rownum<3
union
select deptno,sal from (select * from emp order by sal
desc) where rownum<3 and deptno not in(20);
considering scott table in db.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What found sql?
What is difference between nchar and nvarchar?
What is package in pl sql?
How to place comments in pl/sql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
what is a join? : Sql dba
What is the difference between nested table and varray?
What is the difference between having and a where in sql?
How does stored procedure reduce network traffic?
What are different types of sql?
How do you write an index?
Which are the different case manipulation functions in sql?
What are the parameter modes supported by pl/sql?
What are the different type of joins in sql?
How do you copy a table in sql?