title: What is the query for table 3?
body: <p>I have extracted these two tables from a SQL Database:</p>
  
  <p><img src="https://i.stack.imgur.com/s0AE4.png" alt="table 1"></p>
  
  <p><strong>query for table 1:</strong></p>
  
  <pre><code>SELECT POM_DOCNO,
  POM_DATE,
  SUP_CODE,
  POM_CREATEDBY 
  FROM SI_PURORDERMASTER
  WHERE POM_YEAR = 2012
  AND POM_PERIOD = 6
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/uQamf.png" alt="table 2"></p>
  
  <p><strong>query for table 2:</strong></p>
  
  <pre><code>SELECT POM_DOCNO,
  ITM_ITEMCODE,
  ITM_ITEMDESC,
  POD_QTY,
  POD_RATE
  FROM SI_PURORDERDETAIL
  WHERE POM_YEAR = 2012
  AND POM_PERIOD = 6
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/x2w4K.png" alt="table 3"></p>
  
  <p>query to get table 3 ?</p>
  
  <p>I have tried using joins but always end up with wrong result :/
  Is there anyway to get table 3 with just table 1 &amp; 2 ?
  Both table 1 and 2 have <strong>"POM_DOCNO"</strong> column in common.</p>