mysql if else count 计数

select mobile,avg(total),sum(click_day*click_money),sum(click_day),count(push_status),sum(clicks),count(if (total>=0 and total <600,true,null)) as  house0,count(if (total>=600 and total <1000,true,null)) as  house6,count(if (total>=1000 and total <1500,true,null)) as  house10,count(if (total>=1500 and total <2000,true,null)) as  house15,count(if (total>=2000 and total <3000,true,null)) as  house20,count(if (total>=3000 and total <4000,true,null)) as  house30 from danke_house_result group by mobile;

  

posted on 2019-07-15 15:48  山高似水深  阅读(1793)  评论(0编辑  收藏  举报

购买方式 点击下面图标购买