Hive 差集交集并集

1. 交集:

select id from t1 join select id from t2

2. 并集

select id from t1 union select id from t2

select id from t1 union all select id from t2

select id from t1 intersect select id from t2

3. 差集

select a.id from t1 left join t2 on t2.id = t1.id where t2.id is null

select id from t1 except select id from t2

你可能感兴趣的:(Hive 差集交集并集)