title: [ask]Join two table
body: <p>first query</p>
  
  <pre><code>SELECT material_name,material_type,original,vr,repro,scrap FROM stock_opname
  </code></pre>
  
  <p>have 88 result</p>
  
  <p>second query</p>
  
  <pre><code>  SELECT t.material_name,t.material_type, 
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and destination = 'WAREHOUSE_RESIN' and kind_of_transaction = 'ORIGINAL') as 'total_original',
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and destination = 'WAREHOUSE_RESIN' and kind_of_transaction = 'VR') as 'total_vr', 
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and destination = 'WAREHOUSE_RESIN' and kind_of_transaction = 'SCRAP') as 'total_scrap', 
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and destination = 'WAREHOUSE_RESIN' and kind_of_transaction = 'REPRO') as 'total_repro',
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and source = 'WAREHOUSE_RESIN' and kind_of_transaction = 'ORIGINAL') as 'total_original_out',
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and source = 'WAREHOUSE_RESIN' and kind_of_transaction = 'VR') as 'total_vr_out', 
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and source = 'WAREHOUSE_RESIN' and kind_of_transaction = 'REPRO') as 'total_repro_out',
           (SELECT SUM(qty) FROM temp_data_transaction where material_name=t.material_name and source = 'WAREHOUSE_RESIN' and kind_of_transaction = 'SCRAP') as 'total_scrap_out'
           FROM temp_data_transaction t GROUP BY material_name
  </code></pre>
  
  <p>have 6 result</p>
  
  <p>question
  how to join query two inside query one ?</p>
  
  <p>thanks</p>