Re: DISTINCT and multiple results...

From: Date: Tue, 08 Jun 2004 07:37:42 +0000
Subject: Re: DISTINCT and multiple results...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34681@lists.php.net to get a copy of this message
Hi, maybe you're looking 4 something like this: select user , filename , count(filename) from table group by user,filename having count(filename) = 3 order by 1,2; Rui Tristan.Pretty@risk.sungard.com writes:
Hi there... I'm trying to create a MYSQL query that does the following... I've a table that lists ALL downloads from our site. so I may have the same user many times, but different files, or infact, same user, same file. What my boss wants to see is: If a user downloaded a file 3 times, she doesn't care, she just wants to see that it was downloaded. So I tried using DISTINCT(email), but then I loose the data about the other files that they've downloaded How can I create a query, where I can list only one instance of email, per multiple instatnces of a file name. Does that make sence? I'm reallyu stumped...


« previous php.db (#34681) next »