首页 > 技术文章 > 颤抖吧,骚年们,2016年末最牛逼的sql语句

as3lib 2016-12-19 20:09 原文

select channel_name,from_unixtime(createTime,'%Y-%m-%d') as tdate,
count(deviceid) '安装量',count(case when amt<>0 then 1 end) '付费量'
from v_payitem group by channel_name,tdate

 

count里可以加条件判断,你们见过吗?

推荐阅读