title: Order by with order of writing columns
body: <p>I want to order by first <code>featured_due</code> then <code>nard_apply_date_due</code> and then <code>post_date</code> </p>
  
  <pre><code>$join .= " LEFT JOIN (
              SELECT post_id, meta_value as featured_due
              FROM $wpdb-&gt;postmeta
              WHERE meta_key =  'featured' ) AS DD
              ON $wpdb-&gt;posts.ID = DD.post_id ";
  
  
  $join .= " LEFT JOIN (
              SELECT post_id, meta_value as nard_apply_date_due
              FROM $wpdb-&gt;postmeta
              WHERE meta_key =  'nard_ads_apply_date' ) AS naad
              ON $wpdb-&gt;posts.ID = naad.post_id ";
  </code></pre>
  
  <p>Sort code is:</p>
  
  <pre><code>$orderby =  " metaKey1 desc, metaKey2 desc, $wpdb-&gt;posts.post_date desc ";
  </code></pre>
  
  <p>But I get wrong order.</p>
  
  <p>My final sql query:</p>
  
  <pre><code>SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts 
      LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
      INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
      LEFT JOIN ( SELECT post_id, meta_value as featured_due FROM wp_postmeta WHERE meta_key = 'featured' ) AS DD 
      ON wp_posts.ID = DD.post_id LEFT JOIN ( SELECT post_id, meta_value as nard_apply_date_due 
      FROM wp_postmeta WHERE meta_key = 'nard_ads_apply_date' ) AS naad ON wp_posts.ID = naad.post_id 
      JOIN ( SELECT post_id FROM wp_postmeta WHERE meta_key = 'custom_field_ID_2' and (meta_value &lt;= 100000000000 and meta_value &gt;= 0)) AS JJ 
      ON wp_posts.ID = JJ.post_id WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (72,189,190,191,192,232,233,234) ) 
      AND ( ( wp_postmeta.meta_key = 'closed' AND wp_postmeta.meta_value = '0' ) )
      AND wp_posts.post_type = 'project' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
      AND (1=1 AND (wp_posts.post_title LIKE '%%' OR wp_posts.post_content LIKE '%%') )
      GROUP BY wp_posts.ID ORDER BY featured_due desc, nard_apply_date_due desc, wp_posts.post_date desc LIMIT 0, 10
  </code></pre>
  
  <p>i get result - but it have random order! i want featured_due in first and then nard_apply_date_due</p>
  
  <p>Thanks for your help.</p>