Re: MySQL query, using DISTINCT...

From: Date: Wed, 07 Jul 2004 21:36:19 +0000
Subject: Re: MySQL query, using DISTINCT...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35144@lists.php.net to get a copy of this message
i don't know if someone already gave you a suggestion such as: select distinct mail from ( select mail , filename, count(*) from table having count(*) > 1 group by mail,filename ); i presume that you're looking for disctinct mails of users that downloaded the same file more than once. hope it helps Rui Cunha Tristan.Pretty@risk.sungard.com writes:
I have a system that tracks downloads, capturing loadsa info, but of interest here, is email and filename. Simply put, I wanna show all results where file name AND email are unique. (so if email '123@hotmail.com' has filename 'word.doc' 5 times in a table, I want to only see it once.) What am I doing wrong...? SELECT DISTINCT(file_name, email) FROM completed_downloads WHERE bu = 'reech' AND date BETWEEN '2004-06-01' AND '2004-06-30' Tris... ********************************************************************* The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***********************************************************************


« previous php.db (#35144) next »