SQL中关于条件Count的查询语句问题

2025-03-23 00:35:33
推荐回答(2个)
回答1:

Select A,
count(B) as total,
sum(case when B > 30 then 1 else 0 end) as total1,
sum(case when B > 20 then 1 else 0 end) as total2
from ABC group by A

回答2:

去看帮助文档