SELECT p.product_code, sum(o.sales_amount*p.price) as sales
from product p, offline_sale o
where p.product_id = o.product_id
group by p.product_code
order by sales desc, p.product_code;
group by 약간 헷갈린닷 ..
처음에
sum(o.sales_amount * p.price) <- 얘를
sum(o.sales_amount) * p.price 일케 했는데 계속 안되길래 뭐지했는데