SELECT *
FROM emp, dept
WHERE emp.deptno= dept.deptno;
SELECT ename, dname
FROM emp, dept
WHERE emp.deptno=dept.deptno;
SELECT ename, dname
FROM emp, dept
WHERE emp.deptno=dept.deptno
AND ename = 'JAMES';
SELECT ename, dname, emp.deptno
FROM emp, dept
WHERE emp.deptno=dept.deptno
AND ename = 'JAMES';
SELECT E.ename, D.dname, E.deptno
FROM emp E , dept D
WHERE E.deptno=D.deptno
AND ename = 'JAMES';
'=' 연사자 제외
SELECT * FROM salgrade;
SELECT ename, sal, grade
FROM emp, salgrade
WHERE sal BETWEEN losal AND hisal;
SELECT E.ename, D.dname, E.sal, S.grade
FROM emp E, dept D, salgrade S
WHERE E.deptno=D.deptno
AND E.sal BETWEEN losal AND hisal;
FROM emp EMPLOYEE, emp MANAGER
WHERE EMPLOYEE.mgr= MANAGER.empno;
다른쪽 테이블에는 데이터가 업을 경우 그 데이터가 출력되지 않는 것을 해결할 수 있습니다
SELECT EMPlOYEE.ename || '의 MANAGER 는 ' || MANAGER.ename || '입니다'
FROM emp EMPLOYEE, emp MANAGER
WHERE EMPLOYEE.mgr= MANAGER.empno(+);
SELECT E.ename, E.sal
FROM emp E, dept D
WHERE E.deptno=D.deptno
AND D.loc LIKE 'NEW YORK';
SELECT EA.ename,EB.ename
FROM emp EA, emp EB
WHERE EA.deptno=EB.deptno
AND EA.ename = 'SMITH'
AND EA.ename!=EB.ename; -- 왼쪽과 오른쪽에 같은 이름을 가진 컬럼제거