title: MySQL How to Order By a Case in Select Statement
body: <p>I've kind of hit a brick wall here. Not sure if this is feasible but thought i'd give StackOverflow a try. I have a Select statement with a Case within the select statement. For example:</p>
  
  <pre><code>SELECT
     CASE
        WHEN A.X = 1 THEN B.A
        WHEN A.X = 2 THEN B.B
        ELSE B.C
     END AS `Example`,
     A.Y,
     A.Z
     .....
  </code></pre>
  
  <p>I'd like to order by <code>Example</code>. Anyone know how to properly write this?</p>
  
  <p>Thanks!</p>