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
UNION
SELECT DEPT, MAX(SAL)
FROM EMP
WHERE SAL NOT IN
(SELECT MAX(SAL)
FROM EMP
WHERE SAL NOT IN (SELECT MAX(SAL) FROM EMP GROUP
BY DEPT)
GROUP BY DEPT
UNION
SELECT MAX(SAL) FROM EMP GROUP BY DEPT)
GROUP BY DEPT
| Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
What is sqlexception in java?
How many types of index are there?
What are the parts of a basic sql query?
What are the methods of filing?
What are the different operators available in sql?
What is embedded sql with example?
Where not exists in sql?
what is sql profiler? : Sql dba
What are different types of statements supported by sql?
What is the sql query to display the current date?
How to run sql statements through the web interface?
What are the types of join in sql?
which types of join is used in sql widely? : Sql dba
Define the select into statement.
how can we know the number of days between two given dates using mysql? : Sql dba