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
Does sql profiler affect performance?
How long will it take to learn pl sql?
Explain unique key in sql.
How do I save the results of sql query in a file?
How delete all records from table in sql?
What is the difference between instead of trigger and after trigger?
What is delimiter in pl sql?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What is vector point function?
how do you login to mysql using unix shell? : Sql dba
what is error ora-03113: end-of-file on communication channel?
What are the features of pl sql?
What does the sign mean in sql?
What is sharding in sql?
Why do we need view in sql?