Distinct with Order By

From: Date: Tue, 16 Dec 2003 07:09:33 +0000
Subject: Distinct with Order By
Groups: php.db 
Request: Send a blank email to php-db+get-32067@lists.php.net to get a copy of this message
I'm looking for the last six different people to make entries to a table, but this syntax: SELECT DISTINCT Poster_ID FROM Posting ORDER BY Posting_Date DESC LIMIT 6; Gives a result which is absolutely not ordered by date. Removing the DISTINCT keyword results in a correct list of the last six people, but they can all be the same person, which won't do. I've found some reference on mysql.com to this being a tricky combination (due to optimization), but there wasn't enough info there for me to go on. It talked about using temporary tables, but that's out of my experience. Can someone give me some advice on this? -e

« previous php.db (#32067) next »