leetcode 1251 平均售價
select r.product_id, round(sum(r.price * r.units) / sum(r.units), 2) as average_price from ( select p.product_id, p.price , u.units from Prices p left join UnitsSold u on p.product_id = u.product_id where u.purchase_date between p.start_date and p.end_date ) r group by r.product_id
==
标签:product,date,price,leetcode,售價,1251,units,id From: https://www.cnblogs.com/carlzhang19/p/17393757.html