insert into where not exists in hive

后端 未结 1 1713
长情又很酷
长情又很酷 2021-01-15 06:00

I need the hive syntax for this equivalent in ansi sql

insert into tablea
(id)
select id 
from tableb
where id not in (select id from tablea)
相关标签:
1条回答
  • 2021-01-15 06:26

    Use left outer join with a filter that the tableA.id is null:

    insert overwrite into tableA (id)
    select b.id from tableB b left outer join tableA a
     on a.id = b.id
    where a.id is null
    
    0 讨论(0)
提交回复
热议问题