Hive 如何替换';不在';在配置单元0.13中,因为它不受支持?
考虑到这一问题:Hive 如何替换';不在';在配置单元0.13中,因为它不受支持?,hive,Hive,考虑到这一问题: select distinct col1,col2 from table where col1='x' and (col1,col2) not in (select col1,col2 from table1) order by col1, col2 如何在不支持不在的配置单元版本0.13中实现上述查询 我尝试使用减号,但显然减号也不受支持您可以这样做: select distinct t.col1, t.col2 from table t left outer join
select distinct col1,col2
from table
where col1='x' and (col1,col2) not in (select col1,col2 from table1)
order by col1, col2
如何在不支持不在的配置单元版本0.13中实现上述查询
我尝试使用减号,但显然减号也不受支持您可以这样做:
select distinct t.col1, t.col2
from table t left outer join table1 t1
on t.col1 = t1.col1 and t.col2 = t1.col2
where t.col1 = 'x' and
t1.col1 is null and t1.col2 is null
order by t.col1, t.col2;
说明:在
表
和表1
之间的左外联接中,每当表1
的列为空时,这意味着表
中的相应列不在表1
中,但有一些限制,请参阅。如果您有较旧的版本,您的问题已经得到了回答。可能重复欢迎使用堆栈溢出!,从评论中,我编辑了你们的问题,以提高标题(作为一个句子),格式化代码的可读性和一些次要的功能spelling@javatp-在这种情况下,您应该对答案进行投票并将其标记为接受-回答者会因其努力而获得一些分数,而回答此问题的人也会受益:-)