Saturday, May 9, 2009

Compare more than one value

Get employees have minimum salary in their departments.


SELECT ENAME, JOB, DEPTNO, SAL
FROM EMP
WHERE (SAL,DEPTNO) IN (SELECT MIN(SAL), DEPTNO
FROM EMP
GROUP BY DEPTNO)

No comments:

Post a Comment