Hive command to execute NOT IN clause

Viewed 16797

I have two tables,tab1 & tab2.

tab1(T1)  tab2(T2)
a1         b1
b1         c1
c1         f1
d1         g1

I am looking for the values from table T1 that are not present in T2. In this case, the output should be a1 d1

I have tried with the following query but couldn't get the right solution.

select distinct tab1.T1 from tab1 left semi join tab2 on (tab1.T1!=tab2.T2);
1 Answers
Related