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
Why truncate is used in sql?
Why we use pl sql?
How do you run a query?
What is the use of prepared statement?
how are mysql timestamps seen to a user? : Sql dba
how to use case expression? : Sql dba
Is hadoop a nosql?
Why do we need cursors in pl sql?
What is cost in sql execution plan?
What is the difference between having and a where in sql?
What are the types of functions in sql?
How do you know if a relationship is 2nf?
How do I restart sql?
What is information schema in sql?
what is primary key? : Sql dba