title: How to combine 2 tables and insert values into a 3rd table
body: <p>I have 2 tables formatted the following ways listed below... </p>
  
  <p>T1</p>
  
  <pre><code>ID   SUB_ID   NAME   NUM
  123  ABC      TEST   5
  456  XYZ      HELLO  10
  </code></pre>
  
  <p>T2</p>
  
  <pre><code>ID   SUB_ID   NAME   NUM  CAT  ACTY
  123  ABC      TEST   5    sjq  h5h
  456  XYZ      HELLO  10   hwl  888
  </code></pre>
  
  <p>I want to look at these 2 tables and match based on ID and SUB_ID and join them together so I get all the columns from T1 and those columns missing from T1 that are in T2</p>
  
  <p>Both these tables contain thousands of rows but I simplified for this example. </p>
  
  <p>This is the code I have tried but I am getting to many rows back.. </p>
  
  <pre><code>SELECT * 
  FROM T1 YY
  INNER JOIN T2 ZZ
  WHERE YY.ID = ZZ.ID and YY.SUB_ID = ZZ.SUB_ID
  </code></pre>
  
  <p>Any help on how to execute this would be GREATLY appreciated. THANKS!! </p>