https://school.programmers.co.kr/learn/courses/30/lessons/131533
sum과 같은 집계함수를 사용할 때에는 group by를 사용해 주어야 한다.
SELECT PRODUCT_CODE, SUM(PRICE * SALES_AMOUNT) AS SALES
FROM PRODUCT
JOIN OFFLINE_SALE
ON PRODUCT.PRODUCT_ID = OFFLINE_SALE.PRODUCT_ID
GROUP BY PRODUCT.PRODUCT_ID
ORDER BY SALES DESC, PRODUCT_CODE ASC;