Subquery

Published on by LakshmiSaahul,Dhana Royal

select emp_id, lastname
from emp c
where not exists
(select * from gift o where o.emp_id = c.emp_id);

SELECT e1.ename, d.dname
FROM emp e1, dept d
WHERE e1.deptno = d.deptno
AND EXISTS
(SELECT 'x' FROM emp e2
WHERE e2.ename = 'Smart' AND e2.deptno =
e1.deptno)

Advertising
To be informed of the latest articles, subscribe:
Comment on this post