consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.
Answer Posted / vishnu prasad.ma
SELECT A.EMP_NAME, SUM(B.MAX_SALARY) AS MAX_SAL, B.EMP_DEPT_NO FROM EMP_DETAILS A,
(SELECT MAX(EMP_SAL) AS MAX_SALARY, EMP_DEPT_NO FROM EMP_DETAILS WHERE EMP_DEPT_NO IN (10,20)
GROUP BY EMP_DEPT_NO) B
WHERE
A.EMP_SAL = B.MAX_SALARY
AND A.EMP_DEPT_NO = B.EMP_DEPT_NO
GROUP BY A.EMP_NAME, B.EMP_DEPT_NO
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are some emotional triggers?
What is difference between db2 and sql?
Is join an inner join?
Is natural join and inner join same?
How do I truncate a sql log file?
Does pl sql work in mysql?
What is sql scripting?
What is a rank in sql?
How does postgresql compare to mysql?
Can there be more than one function with a similar name in a pl/sql block?
What is sql engine in oracle?
Whis is not false in primary key?
How do I run a sql trace?
When is the update_statistics command used?
What is the difference between left join and right join?