select name as 姓名,
sum( case when cargo='笔' then 1 else 0 end ) as 笔,
sum( case when cargo='橡皮' then 1 else 0 end ) as 橡皮
from shopping group by name;

posted on 2019-03-15 15:24  足下之路  阅读(5658)  评论(0编辑  收藏  举报