题解 | #确定已售出产品项 BR01 的总数#
确定已售出产品项 BR01 的总数
http://www.nowcoder.com/practice/a225d8a7bc4f496283fe8e21293e841c
使用group by 写法,先分组然后再添加过滤条件
select sum(quantity) from OrderItems group by prod_id having prod_id="BR01"
直接使用where语句写 select sum(quantity) from OrderItems where prod_id="BR01"