You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
selectp.product_id, ifnull(round(sum(u.units*p.price) /sum(u.units), 2), 0) as average_price from Prices as p left join UnitsSold as u onu.product_id=p.product_idandu.purchase_date between p.start_dateandp.end_dategroup byp.product_id;