select count(*) from (select day, product_id, dealer_id, count(distinct(member_id)) as user_num, count(if(is_first=1,1,0)) as first_scan_num from ydd_fw_scans where day = 20240212 group by day, product_id, dealer_id) as a;
select count(*) from (select day, product_id, dealer_id, count(distinct(member_id)) as user_num, count(if(is_first=1,1,0)) as first_scan_num from ydd_fw_scans where day = 20240212 group by day, dealer_id, store_id, product_id) as a;