#70. JOIN : 5월 식품들의 총매출 조회하기 | 프로그래머스 | SQL 고득점 Kit
문제 입력 코드 SELECT P.PRODUCT_ID, P.PRODUCT_NAME, SUM(O.AMOUNT * P.PRICE) AS TOTAL_SALES FROM FOOD_PRODUCT AS P JOIN FOOD_ORDER AS O ON P.PRODUCT_ID = O.PRODUCT_ID WHERE O.PRODUCE_DATE BETWEEN '2022-05-01' AND '2022-05-31' GROUP BY O.PRODUCT_ID ORDER BY TOTAL_SALES DESC, O.PRODUCT_ID ASC; 조건1. 생산일자가 2022년 5월인 식품 # 1. BETWEEN WHERE O.PRODUCE_DATE BETWEEN '2022-05-01' AND '2022-05-31' # 2. LIKE WHERE ..