2019-07-01
阅读量:
810
Mysql中使用count加条件统计
使用count()函数实现条件统计的基础是对于值为NULL的记录不计数,常用的有以下三种方式,假设统计num大于200的记录
select count(num > 200 or null) from a;
select count(if(num > 200, 1, null)) from a
select count(case when num > 200 then 1 end) from a






评论(0)


暂无数据
推荐帖子
0条评论
1条评论
0条评论