Hive中求交集和差集的两种方法:
--1.交集:
select id from t1 intersect select id from t2
--2.差集
select a.id from t1 left join t2 on t2.id = t1.id and t2.id is null;
select id from t1 except select id from t2
Hive中求交集和差集的两种方法:
--1.交集:
select id from t1 intersect select id from t2
--2.差集
select a.id from t1 left join t2 on t2.id = t1.id and t2.id is null;
select id from t1 except select id from t2