[SQL문제풀기] 상품 별 오프라인 매출 구하기(JOIN)

241127
이나겸's avatar
Nov 27, 2024
[SQL문제풀기] 상품 별 오프라인 매출 구하기(JOIN)
Contents
Q.풀이

Q.

notion image
 
 

풀이

select b.product_code, sum(b.price * a.sales_amount) as sales from product as b join offline_sale as a on b.product_id = a.product_id group by b.product_code order by sales desc, b.product_code asc;
Share article

Nakyeom's Study