title: DESC in SQLite conditional ORDER BY
body: <p>I need to select records ordered by the following logic, however SQLite raises an error when DESC is in the conditional.</p>
  
  <pre><code>ORDER BY
  CASE 
    WHEN parentGUID IS NULL THEN datePosted DESC
    ELSE datePosted
  END
  </code></pre>
  
  <p>This is to achieve Facebook like ordering =- original posts (which always have null parentGUIDs) in order descending by date and replies to original posts ordered by date ascending.</p>