Hive查询问题

来源:互联网 发布:html引入php文件 编辑:程序博客网 时间:2024/05/15 07:47

到目前为止最新的hive(hive-0.11.0),也不支持 in(select...)和not in (select...),


对于not in (select...):

select t1.stransno from upa_test_01 t1 where t1.stransno not in(select t2.stransno from upa_test_02 t2); 
可以通过类似这样的方式查询:

select t1.stransno from upa_test_01 t1 left outer join upa_test_02 t2 on t1.stransno = t2.stransno where t2.stransno is null; 


对于 in(select...)

通过 LEFT SEMI JOIN


原创粉丝点击