1. Single Line SubQueries
SELECT * FROM EMP
WHERE DEPTNO = (SELECT DEPTNO
FROM DEPT
WHERE DNAME = 'OPERATION')
2.Multi Line SubQueries
1. SELECT * FROM EMP
WHERE DEPTNO IN (SELECT DEPTNO
FROM DEPT
WHERE DNAME LIKE 'A%')
2. SELECT * FROM DEPT
WHERE DEPTNO IN (SELECT DEPTNO
FROM EMP
WHERE ENAME LIKE '%E%')
SELECT * FROM EMP
WHERE DEPTNO = (SELECT DEPTNO
FROM DEPT
WHERE DNAME = 'OPERATION')
2.Multi Line SubQueries
1. SELECT * FROM EMP
WHERE DEPTNO IN (SELECT DEPTNO
FROM DEPT
WHERE DNAME LIKE 'A%')
2. SELECT * FROM DEPT
WHERE DEPTNO IN (SELECT DEPTNO
FROM EMP
WHERE ENAME LIKE '%E%')
No comments:
Post a Comment