๋ฐ์ํ
https://school.programmers.co.kr/learn/courses/30/lessons/131533
-- ์ฝ๋๋ฅผ ์
๋ ฅํ์ธ์
SELECT P.PRODUCT_CODE, sum(O.SALES_AMOUNT*P.PRICE) as PRICE
from PRODUCT P join OFFLINE_SALE O on P.PRODUCT_ID = O.PRODUCT_ID
group by P.PRODUCT_CODE
order by PRICE desc, P.PRODUCT_CODE asc
๋ฐ์ํ