select sum(active_count) as "111",sum(active_count_month) as "333" from ( select active_count,active_count_month,dt,channel,appid, case when device_type = 'ios' then '苹果' when device_type = 'wechat' then '微信' when device_type = 'android' then '安卓' else '其他' end as device_type from aaaaa ) as aa WHERE 1=1 <parameter> AND dt BETWEEN '${start}' AND '${end}' </parameter> <parameter> AND device_type IN ('${device_type}') </parameter> <parameter> AND channel IN ('${channel}') </parameter> <parameter> AND appid IN ('${appid}') </parameter> |