select
count(*) as number,count(IF( t.isAbandon = '1', 1, NULL)) as a,
count(IF( t.isAbandon = '0', 1, NULL)) as b
from t_device t
mysql的count+if判断(用来计算数量)
最新推荐文章于 2025-03-05 17:36:05 发布
select
count(*) as number,count(IF( t.isAbandon = '1', 1, NULL)) as a,
count(IF( t.isAbandon = '0', 1, NULL)) as b
from t_device t