본문 바로가기
스터디/Oracle

[Oracle] JOIN / LEFT JOIN / RIGHT JOIN / FULL OUTER JOIN

by 홍장 2021. 4. 9.
기본 테이블 조회
select * from TB_GRADE;
select * from TB_CLASS_INFO;

 

Join
select * from TB_GRADE A, TB_CLASS_INFO B where A.class_cd = B.class_cd;
select * from TB_GRADE A join TB_CLASS_INFO B on A.class_cd = B.class_cd;


테이블 조회  
select * from TB_GRADE_08;
select * from TB_GRADE_09;

SELECT * FROM tb_grade_08 A JOIN tb_grade_09 B ON A.test_cd = B.test_cd;
SELECT * FROM tb_grade_08 A LEFT JOIN tb_grade_09 B ON A.test_cd = B.test_cd;
SELECT * FROM tb_grade_08 A RIGHT JOIN tb_grade_09 B ON A.test_cd = B.test_cd;
SELECT * FROM tb_grade_08 A FULL OUTER JOIN tb_grade_09 B ON A.test_cd = B.test_cd;