on t2.partition_date=dev.partition_date and t2.cl_id=dev.device_id
WHERE spam_pv.device_id IS NULL
and dev.device_id is null
GROUP BY t1.partition_date,t1.device_os_type,t1.active_type,t2.card_content_type,t2.recommend_type having t2.session_pv0 >= 4 or having t3.session_pv >0
GROUP BY t1.partition_date,t1.device_os_type,t1.active_type,t2.card_content_type,t2.recommend_type having t2.session_pv0 >= 4 or t3.session_pv >0
order by day_id,device_os_type,active_type,card_content_type,recommend_type