select distinct in query

From: Date: Fri, 18 Oct 2002 13:17:11 +0000
Subject: select distinct in query
Groups: php.install 
Request: Send a blank email to php-install+get-8851@lists.php.net to get a copy of this message
hi guys i am trying to use a distint query like so "SELECT DISTINCT tp.userID,DATE_FORMAT(tp.date,\"%W, %D %M %Y\") AS date,tp.photo,tp.galleryID,u.username,g.gallery FROM temp_photos tp LEFT JOIN users u ON tp.userID=u.userID LEFT JOIN galleries g ON tp.galleryID=g.galleryID" i am getting many results as photo is different, i am needing to simply get distinct on the userID and want to get the other fields aswell, how is this possile ?

« previous php.install (#8851) next »