title: Help regading not in and inner join
body: <p>I have two tables. Table1 and Table2</p>
  
  <p><strong>Table1</strong></p>
  
  <pre><code>id tid
  1  100
  2  200
  3  300
  </code></pre>
  
  <p><strong>Table2</strong></p>
  
  <pre><code>tid name
  100 A
  200 B
  </code></pre>
  
  <p>I want to take out id of records from Table1 whichever's tid is not present in Table2.</p>
  
  <p>My output should be like this.</p>
  
  <p><strong>Table1.id</strong></p>
  
  <pre><code>3
  </code></pre>
  
  <p>For this i have written following queries but it is taking too much of time. Since 
  both tables have more amount of records.</p>
  
  <p>please help me how to write a query for this such a way that it will take less amount of time.</p>
  
  <pre><code>select id from Table1 where tid not in (select tid from Table2)
  select a.id from Table1 a inner join Table2 b on a.tid&lt;&gt;b.tid
  </code></pre>
  
  <p>TIA.</p>