I am trying to create a query that will display the name, dep no. , and all the workers that work in the same dep as a specific person. I have written some code for it but its giving an error.
SELECT d.deptno ,d.ename , e.ename
FROM emp e, emp d
WHERE deptno = ( SELECT DISTINCT deptno
from emp
WHERE d.deptno = e.deptno );
Cheers
-Jay
Try: