title: In MySQL how do I update a batch of fields to concatenate their values with those that correspond to the entity_id in the same table?
body: <p>I hope I'm explaining this clearly enough: In our Magento database I have the following two queries I somehow need to combine (I'm a SQL novice):</p>
  
  <pre><code>update catalog_product_entity_text 
  set `value` = CONCAT('', `value`)
  where entity_id in (select product_id from catalog_category_product where category_id = 975)
  and attribute_id = 57;
  
  select `value` from catalog_product_entity_text 
  where entity_id in (select product_id from catalog_category_product where category_id = 571) 
  and attribute_id = 551;
  </code></pre>
  
  <p>The blank value in the CONCAT function in the first query needs to contain the value from the second query that corresponds to the current entity_id in the loop. </p>
  
  <p>Just how do go about I achieving this? Thanks much.</p>
  
  <p>UPDATE: I'm reading up on joins and it looks as though a left outer join on the same table would be the way, though I'm still rather unclear as to the proper syntax and utilization.</p>
  
  <p>Here's a rough draft that is not even passable:</p>
  
  <pre><code>select `value` from catalog_product_entity_text
      as mobile_description
  where attribute_id = 551
      and entity_id in (select product_id
          from catalog_category_product
          where category_id = 571)
  join on entity_id;
  </code></pre>
  
  <p>How do I improve upon that to make it effective? </p>
  
  <p>I'm trying to join the rows with attribute_id = 57 &amp; attribute_id = 551, fetching the <code>value</code> column from each, for those with the same entity_id, so that I may update the <code>value</code> of the row with attribute_id = 57 to include the value of the corresponding record with attribute_id = 551.</p>