with tc as ( select user_id, count(*) as cnt from `reby-cloud.analytics_reby_v1_eu.transactions_combined` where date(created_at) < current_date group by 1 ), trf as ( select user_id, count(*) as cnt from `reby-cloud.analytics_reby_v1_eu.transactions_combined_reassigned_final` where date(created_at) < current_date group by 1 ) select * from ( select tc.user_id, tc.cnt as tc_cnt, trf.cnt as trf_cnt from tc left join trf on tc.user_id = trf.user_id --where tc.user_id = 'usr_3sqh76qtht1s97xa1qu1' ) where tc_cnt > trf_cnt
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter