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 is sql profiler in oracle?
List and explain the different types of join clauses supported in ansi-standard sql?
what are the 'mysql' command line options? : Sql dba
What is the difference between Union and Union all. Which is faster.
Which is faster view or stored procedure?
Explain what is a field in a database and record in a database?
What is cartesian join in sql?
What is a mutating table and a constraining table?
Is it possible to update views?
What are character functions in sql?
what is 'mysqld'? : Sql dba
what is a view? : Sql dba
Name three sql operations that perform a sort.
How to select unique records from a table?
What is interval partition?