title: Select table rows when value from other table is null
body: <p>is there a way to select rows using values from another table?</p>
  
  <p><a href="https://i.stack.imgur.com/M4AcA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M4AcA.png" alt="enter image description here"></a></p>
  
  <p>I want to select data on table 1 using table2</p>
  
  <p><a href="https://i.stack.imgur.com/pABTa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pABTa.png" alt="enter image description here"></a></p>
  
  <p>Output will be</p>
  
  <p><a href="https://i.stack.imgur.com/z8nwI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z8nwI.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/z8nwI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z8nwI.png" alt="enter image description here"></a></p>
  
  <p>I have 2 instances in selecting values in table1 that's why I'm trying to use case on this one, I'm not just sure if it is correct.</p>
  
  <pre><code>select
  case when table2.s_num is Null and table2.s_div is Null then
  (select * from table1 where table1.item_num = table2.i_num)
  from table1, table2
  </code></pre>
  
  <p>Here are my instances: </p>
  
  <pre><code>1. if t2.s_num is null and t2.s_div is null then select * from t1 where     t1.item_num = t2.i_num 
  2. if t2.s_num is null and t2.s_div is not null then select * from t1 where t1.item_num = t2.i_num and t1.store_div = t2.s_div
  </code></pre>
  
  <p>I'm not that good in sql, any ideas? thanks!</p>