SQL怎么统计在某个字段中某个值出现的总次数

2024-11-25 20:54:13
推荐回答(2个)
回答1:

select sum(case when value='sh' then 1 esle 0 end) sh, sum(case when value='bj' then 1 esle 0 end) bj,name
from table
group by name

回答2:

左转数学吧——from here’s to change 8❎