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判断(用来计算数量)
最新推荐文章于 2024-06-27 11:29:35 发布
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