Warning: SQL newbie... I'm trying to create a query where the most recent entry for each user is returned from a forum table, and sorted by username. The fields are simply: user_id, username, post, last_updated. No primary key defined.
I've tried the simple "SELECT * FROM posts GROUP BY user_id DESC ORDER BY username". It sorta returns what I'm after, but not the latest post from each user, (but the first post). Now my understanding of the GROUP BY function may not be correct, but according to the MySQL manual adding DESC after GROUP BY should return what I'm after but doesn't appear to do so. Any hints? PS. Table type is InnoDB, running on MySQL 4.0.16-max-nt. Darran -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]