본문 바로가기

Programming/SQL

[MYSQL] 우유와 요거트가 담긴 장바구니

 

Programmers -> Summer/Winter Coding(2019)

 

 

 

문제 설명

SELECT A.CART_ID FROM
(SELECT CART_ID FROM CART_PRODUCTS WHERE NAME = 'Milk') AS A JOIN
(SELECT CART_ID FROM CART_PRODUCTS WHERE NAME = 'Yogurt') AS B
ON A.CART_ID = B.CART_ID;

 

❗ JOIN 할 때 ON으로 묶어줄 칼럼 정하는거 잊지말기