title: Is there a more efficient way to run multiple UPDATE sql statements
body: <p>I'm a bit of a noob when it comes to sql queries, and I only really have worked with the basic SELECT, UPDATE, DELETE statements. Now I need to update a lot of rows (50+) in a vertical table, and im running the statements like this:</p>
  
  <pre><code>UPDATE `postmeta` SET meta_value = 'John' WHERE `meta_key` = 'name' AND `post_id` = 29230;
  UPDATE `postmeta` SET meta_value = 'Johnson' WHERE `meta_key` = 'last_name' AND `post_id` = 29230;
  UPDATE `postmeta` SET meta_value = 'www.johnsonsdiner.com' WHERE `meta_key` = 'url' AND `post_id` = 29230;
  UPDATE `postmeta` SET meta_value = 'john@johnson.com' WHERE `meta_key` = 'mail' AND `post_id` = 29230;
  UPDATE `postmeta` SET meta_value = '12341234' WHERE `meta_key` = 'phone' AND `post_id` = 29230;
  ... + 45 more
  </code></pre>
  
  <p>Notice that the post_id is the same, while the meta_key differs. </p>
  
  <p>is there a better way to run all these updates, that would have better performance for mySQL? would it make a difference to add a LIMIT 1 to each statement?</p>
  
  <p>Any help is appreciated</p>