title: How to conditionally convert inches to cm in MySQL (or similar conversions during SELECT)?
body: <p>I have a table similar to the following:</p>
  
  <pre><code>value    unit
  -----    -----
  100      cm
  30       in
  120      cm
  35       in
  37       in
  29       in
  </code></pre>
  
  <p>In my selection, I'd like to convert inches to centimeters.  Something like the following:</p>
  
  <pre><code>SELECT AVG(unit = in ? value*2.54 : value) FROM data_table;
  </code></pre>
  
  <p>What is the proper syntax, or method to perform this type of selection in MySQL?</p>