题解 | #从 Products 表中检索所有的产品名称以及对应的销售总数#
从 Products 表中检索所有的产品名称以及对应的销售总数
http://www.nowcoder.com/practice/2b289b78de1546f38fd24e17e56f1bec
SELECT p.prod_name, o.quant_sold
FROM
(
SELECT a.prod_id, SUM(a.quantity) as quant_sold
from OrderItems a
group by a.prod_id
) o, Products p
where o.prod_id = p.prod_id;