(select first_device as device_id from online.ml_user_history_detail where partition_date = '{today_str}' and date_joined >= '{yesterday_str}' and date_joined <= '{today_str_format}') t2
(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