title: Using boolean expression in order by clause
body: <p>I have an order by clause that looks like:</p>
  
  <pre><code>( user_id &lt;&gt; ? ), rating DESC, title
  </code></pre>
  
  <p>Where ? is replaced with the current user's id.</p>
  
  <p>On postgresql this gives me the ordering I'm looking for i.e. by current user, then highest rating, then title (alphabetically).</p>
  
  <p>However on MySQL I get an unclear order current user is neither first nor last, nor is it by rating or title.</p>
  
  <p>Is my only option for cross database compatibility to replace this quick and dirty boolean expression with a CASE WHEN .. THEN .. ELSE .. END statement?</p>
  
  <p>Edit: Thanks all for the assistance, it is as correctly pointed out by Chaos and Chad Birch the case that the problem lies elsewhere <em>(specifically that I'm using the results of the above query as input into the next - then acting surprised that the order of the first is lost ;)</em></p>