Hive 差集交集并集

作者: 苏啦啦哇咔咔 | 来源:发表于2019-04-30 15:43 被阅读0次

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 and t2.id is null

select id from t1 except select id from t2

相关文章

网友评论

    本文标题:Hive 差集交集并集

    本文链接:https://www.haomeiwen.com/subject/bojvnqtx.html