게시글
테이블2개일때 차집합,교집합 구하는 방법
A테이블,B테이블 각각존제할때 A.idx_code -> 1,2,3,4 B.idx_code -> 2,3 일때 B.idx_code값을 빼고 A.idx_code -> 1,4만 호출하는 방법 select * from A where code not in (select idx_code from B) -> 차집합을 구할수 있다 select * from A where code in (select idx_code from B) -> 2,3처럼 교집합 내용을 구할수 있다
#프로그램 #소스 #Mysql #서브쿼리 #차집합 #교집합 #notin #테이블비교