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
Can we perform dml on view?
If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????
What is faster join or subquery?
How to run sql*plus commands in sql developer?
Can %notfound return null after a fetch?
Why do we use function in pl sql?
What does pl sql stand for?
how can we destroy the cookie? : Sql dba
Is ms sql traffic encrypted?
What is data types in sql?
What is java sql drivermanager?
Can ddl statements be used in pl/sql?
What are conditional predicates?
What is vector point function?
Explain character-manipulation functions?