최대 1 분 소요

프로그래머스 사이트 링크

문제

image

image


코드

ver(1) - JOIN 사용
SELECT B.INGREDIENT_TYPE, SUM(A.TOTAL_ORDER) AS TOTAL_ORDER
FROM FIRST_HALF AS A
JOIN ICECREAM_INFO AS B
ON A.FLAVOR = B.FLAVOR
GROUP BY B.INGREDIENT_TYPE
ver(2) - WHERE 사용
SELECT I.INGREDIENT_TYPE, SUM(F.TOTAL_ORDER) AS TOTAL_ORDER
FROM ICECREAM_INFO I, FIRST_HALF F
WHERE I.FLAVOR=F.FLAVOR
GROUP BY I.INGREDIENT_TYPE
ORDER BY TOTAL_ORDER;

댓글남기기