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;

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM