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