Hive查询无法正常工作,对<=>使用NULL值

时间:2019-08-27 07:01:43

标签: hive hql

我有两个表table1和table2。

table1 (name string, beginDate string)
table2 (sname string, sbeginDate string)

这里的名称/名称也可以是NULL值。我想查找表1中存在但表2中没有的记录。

以下配置单元查询返回

  

无效的表别名或列引用“ dy”

如果我分别运行这两个where子句条件,则它们可以正常工作。但是将它们相加会造成问题。

select dy.beginDate
    from table1 dy
        where not exists (
        select 1
        from table2 db
        where
            datediff(dy.beginDate, db.sbeginDate) = 0 and
            dy.name <=> db.sname 
);

0 个答案:

没有答案