title: MySQL Order before Group by
body: <p>I need to find the latest post for each author and then group the results so I only a single latest post for each author.</p>
  
  <pre><code>SELECT wp_posts.* FROM wp_posts
          WHERE wp_posts.post_status='publish'
          AND wp_posts.post_type='post'
          GROUP BY wp_posts.post_author           
          ORDER BY wp_posts.post_date DESC
  </code></pre>
  
  <p>This is correctly grouping the output so I only get one post per author, but it is ordering the results after they have been grouped and not before they have been selected.</p>