자격증/SQLD

USING절, NATURAL JOIN 쿼리 결과 특징

dev? 2024. 11. 12. 11:06
반응형

INNER JOIN 한 결과 ( USING 이나 NATURAL JOIN을 사용하지 않은 이너 조인의 결과)

  • 양쪽 테이블에 있는 DEPTNO가 출력
SELECT *
FROM EMP A
INNER JOIN DEPT B
ON A.DEPTNO = B.DEPTNO;

 

USING / NATURAL JOIN 한 결과

  • DEPTNO가 1개만 출력
  • JOIN 기준인 컬럼이 맨 앞에 출력
SELECT *
FROM EMP A
JOIN DEPT B
USING (DEPTNO);

SELECT *
FROM EMP A
NATURAL JOIN DEPT B;

반응형