MySQL Forums
Forum List  »  General

GROUP BY and ORDER BY... why doesn't this work?
Posted by: Gabriel Gilder
Date: February 20, 2005 01:12AM

Okay, I have the following query:

SELECT author, id, title, pub_date FROM postings GROUP BY author ORDER BY pub_date DESC;

But it's not working correctly. The grouping is working right, but the id, title, and date selected for each author are not sorted by date (i.e. it's not the latest post). Is ORDER BY just incompatible with GROUP BY in this situation, or am I doing something wrong?

-Gabriel

Options: ReplyQuote


Subject
Written By
Posted
GROUP BY and ORDER BY... why doesn't this work?
February 20, 2005 01:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.