(select first_device as device_id from online.ml_user_history_detail where partition_date = '{today_str}' and date_joined >= '{yesterday_str_format}' and date_joined <= '{today_str_format}') t2
(select device_id from online.ml_device_day_active_status where partition_date = '${today_str}' and active_type in (1,2)) t2
LEFT JOIN
(
select distinct device_id
...
...
@@ -195,6 +195,8 @@ WHERE spam_pv.device_id IS NULL
(select first_device as device_id from online.ml_user_history_detail where partition_date = '{today_str}' and date_joined >= '{yesterday_str_format}' and date_joined <= '{today_str_format}') t2
(select device_id from online.ml_device_day_active_status where partition_date = '${today_str}' and active_type in (1,2)) t2