title: MySQL Update multiple rows on a single column based on values from that same column
body: <p>I have a table that looks like the following:</p>
  
  <pre><code>ID     Key     Value     Order
  1      gender  m         0
  2      gender  f         0
  
  34     age     10        0
  35     age     80        0
  </code></pre>
  
  <p>To update these rows I have to use the following:</p>
  
  <pre><code>UPDATE `DemoGroup` SET `value` = 'male' WHERE `value` = 'm'
  UPDATE `DemoGroup` SET `value` = 'female' WHERE `value` = 'f'
  UPDATE `DemoGroup` SET `value` = '10-19' WHERE `value` = '10'
  UPDATE `DemoGroup` SET `value` = '80-89' WHERE `value` = '80'
  </code></pre>
  
  <p>Is there a way to consolidate this into one update statement, without using the ID (which is not guaranteed to be the same), such as (even though this won't work)...</p>
  
  <pre><code>UPDATE `DemoGroup` 
  SET `value`= CASE `value`
      WHEN 'm' THEN 'male',
      WHEN 'f' THEN 'female' END 
  WHERE `value` = 'm' OR `value` = 'f'
  </code></pre>
  
  <p>Even more of a bonus (but not nessesary) is if I could figure out how to set the Order field as well for each row...</p>