题解 | #从 Products 表中检索所有的产品名称以及对应的销售总数#
从 Products 表中检索所有的产品名称以及对应的销售总数
http://www.nowcoder.com/practice/2b289b78de1546f38fd24e17e56f1bec
select p.prod_name,a.total
from Products p
left join
(select prod_id,sum(quantity) as total
from OrderItems
group by prod_id
)a
on p.prod_id = a.prod_id