title: SQL Sort by temporary "AS" column
body: <p>I want to sort my result by a column that I actually create temoprarly</p>
  
  <pre><code>SELECT A, B, @MID(C,2,2) as X FROM foobar ORDER BY X DESC
  </code></pre>
  
  <p>I know this would work in <strong>MySQL</strong> but it doesn't seams to work in SQL (SQLBase).</p>
  
  <p>Any suggestions?</p>
  
  <p>I tried:</p>
  
  <pre><code>SELECT A, B, @MID(C,2,2) as X FROM foobar ORDER BY @MID(C,2,2) DESC
  </code></pre>
  
  <p>Result was <strong><code>Invalid Columnname</code></strong> same as using <strong><code>ORDER BY X</code></strong> </p>