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;
转载注明出处
如果本文对你有帮助,请帮忙啦~~
打开支付宝首页搜“522901509”领红包,领到大红包的小伙伴赶紧使用哦!