title: conditional order by clause in sql
body: <p>I have a query that should order the result in asc or desc depending upon a column value.</p>
  
  <p>e.g.</p>
  
  <p>if employee of type manager exists THEN order by joining_date, bith_date ASC
  else if employee  is developer THEN order by joining_date, birth_date DESC.</p>
  
  <p>I would like to achieve something like below, but can't achieve that.</p>
  
  <pre><code>ORDER BY CASE WHEN employee_type = 'm'  
                THEN joining_date, birth_date ASC;
                WHEN employee_type = 'd' 
                THEN joining_date, birth_date  DESC; 
  </code></pre>