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
Where is all the data on the internet stored?
What is an oracle stored procedure?
What is difference between joins and union?
how to create a new table by selecting rows from another table in mysql? : Sql dba
Define sql delete statement.
What are the operators in sql?
Is nosql faster than sql?
Is sql a dbms?
Can ddl statements be used in pl/sql?
Why are cursors used?
What is difference between sql and oracle?
What do you mean by field in sql?
What is the requirement of self-join?
Do ddl statements need commit?
Write an sql query to select all records from the table?