,sum(diary_click_pv) as diary_click_pv,sun(diary_exp_pv) as diary_exp_pv,sum(qa_click_pv) as qa_click_pv,sum(qa_exp_pv) as qa_exp_pv
FROM
( --dau
SELECT mas.partition_date,t2.active_type,t2.device_os_type,t2.channel,device_id,sum(diary_click_pv) as diary_click_pv,sun(diary_exp_pv) as diary_exp_pv,sum(qa_click_pv) as qa_click_pv,sum(qa_exp_pv) as qa_exp_pv