i need department wise top 2 employees salary.which logic
i will use
Answer Posted / neetika vardhan
SELECT dept, MAX(sal)
FROM EMP WHERE sal NOT IN (SELECT MAX(sal) FROM emp GROUP
BY dept)
GROUP BY dept
UNION
SELECT dept, MAX(sal)
FROM EMP
GROUP BY dept
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
Which is faster union or join?
Mention what are the benefits of pl/sql packages?
What problem one might face while writing log information to a data-base table in pl/sql?
What are % type and % rowtype?
How do you determine the current isolation level? : Transact sql
Mention what is the use of function "module procedure" in pl/sql?
What is a pragma statement?
Is a foreign key always unique?
What packages are available to pl/sql developers?
how do you tune the slow running queries in oracle db , explain the methodology
What is procedure in pl sql?
What is right join in sql?
Why do we use procedures in sql?
Can we rollback truncate?
define sql insert statement ? : Sql dba