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;
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;
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。