1、背景:和分析师对数的过程,了解到她会使用full outer join 来检测结果表与主表的对齐数量,发现很好用。
2、应用场景:如果主表的所有粒度值都要(如主表粒度是设备,即指所有设备都要在结果表中),如果t1为结果表,t2为主表,例子1、2、3的计算值会为0。
3、full outer join如何使用:
3.1、t1的,与t2的差集数
select count(t1.id) from (
select 1 id union all select 2 id union all select 3 id union all select 4 id union all select 5 id union all select 7 id) t1
full outer join (select 2 id union all select