title: SQL Server 2005 Order BY with an expression
body: <p>Is there a possibility to order the result by an <code>ORDER</code> clause that contains an expression, something like </p>
  
  <pre><code>SELECT colX0 FROM tbp_name ORDER BY (colX1 IS NOT NULL)
  </code></pre>
  
  <p>or also a more complex expression ?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>In the meanwhile I have found a possibility to solve the above problem:</p>
  
  <pre><code>ORDER BY (case WHEN colX1 IS NULL THEN 1 ELSE 0 END ) ASC
  </code></pre>
  
  <p>however the question remains, if there is a possibility to order direct by an expression.</p>