hive anti用法

left anti join

a left anti join b :在查询过程中,剔除a表中和b表有交集的部分。

select a.col
from a 
left anti join b
on a.col= b.col;

相当于

select a.col
from a 
left anti join b
on a.col= b.col;
where b.col is null;

demo

select 
a.col,b.col
from
    (
     Select explode (array(1,2,3,4,5)) AS col
    ) a
left anti join
    (
     Select explode (array(1,2,3)) AS col
    ) b
on a.col=b.col

你可能感兴趣的:(hive,hive,hadoop,数据仓库)