title: update table with data from other table if not null?
body: <p>Basically what I want to do is copy the value of a column from one table to another column in another table.</p>
  
  <p>The query I am using is:</p>
  
  <pre><code>UPDATE t1 
  SET product_code = 
  (SELECT `value` FROM t2 WHERE t2.variant_id = t1.variant_id AND key_id = 10);
  </code></pre>
  
  <p>Which is working fine, but there is a mismatch in columns,</p>
  
  <p>so I need to add in a clause which will only do the update on that row, if the subquery does not return null.</p>
  
  <p>How can I do this?</p>