如何修改联接以消除联接和(...或者...)条件?
select
table1.id,
table1.country,
table1.city,
table1.platform,
sum(table2.installs) as installs
from
schema.table1
inner join schema.table2 on table1.id = table2.id
and (
table1.country = table2.country
or table1.country is null
)
and (
table1.city = table2.utm_source
or table1.utm_source is null
)
and (
table1.platform = table2.platform
or table1.platform is null
)
group by
table1.id,
table1.country,
table1.city,
table1.platform,
这些条件:OR table1.platform IS NULL