I have a main table from which I need to delete rows that are returned in CTE Preferably I would like to do something like that:
with users_to_exclude as (
select uid, date, location_id
from some_previous_ctes_with_logic
)
delete from main_table mt
inner join
users_to_exclude ux
on ux.uid = mt.uid
and ux.date = mt.date
and ux.location_id = mt.location_id
But I have not idea how to approach this in GBQ.
If I had only one key by which I would delete, it would be simpler as I would use all the CTE with a final select field in the where clause.
But where (f1,f2,f3) in (select f1,f2,f3 from..) is not possible in GBQ to my understanding.
So not sure how to do that.
Thanks