title: Hive command to execute NOT IN clause
body: <p>I have two tables,tab1 &amp; tab2. </p>
  
  <pre><code>tab1(T1)  tab2(T2)
  a1         b1
  b1         c1
  c1         f1
  d1         g1
  </code></pre>
  
  <p>I am looking for the values from table T1 that are not present in T2.
  In this case, the output should be <code>a1 d1</code></p>
  
  <p>I have tried with the following query but couldn't get the right solution.</p>
  
  <pre><code>select distinct tab1.T1 from tab1 left semi join tab2 on (tab1.T1!=tab2.T2);
  </code></pre>