title: SQL - auto populate column with correct values
body: <p>Below is the SQL table where <code>CODE1</code> and <code>CODE2</code> are populated and for <code>CODE3</code> I have input the values that I would like to auto populate. There are over 500.000 rows in total.</p>
  
  <pre><code>CODE1   CODE2   CODE3  
   1      100       A  
   2      100       A  
   3      200       B  
   4      300       A  
   5      300       A  
   1      300       A  
   5      400       A  
   6      400       A  
   2      400       A  
   7      500       C
   8      300       A
   7      600       C
   2      800       A
   3      900       B
  </code></pre>
  
  <p>I have to auto populate  <code>CODE3</code> in order to group all connections defined by CODE1 &amp; CODE2. 
  If <code>CODE 2</code> has the same value (100 for rows:1,2) <code>CODE 3</code> will have same value (A) and if <code>CODE 1</code>  has the same value (1 for rows:1,6) <code>CODE 3</code> will have same value (A).</p>
  
  <p>Any idea how to achieve this?</p>
  
  <p>Much appreciated!</p>