Re: MYSQL-Search for duplicates
| From: | J. Wharton | Date: | Tue, 07 May 2002 18:14:44 +0000 |
| Subject: | Re: MYSQL-Search for duplicates | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19025@lists.php.net to get a copy of this message | ||
Works great with just a bit of modification. I actually needed to list all
the duplicates, not just an example of each, so I just did a second query
for all the records with those two identifiers. Thanks!
J. Wharton
"Lutz Brückner" <lb@lamuella.de> wrote in message
news:m3r8kpytfr.fsf@linux.local...
> Hi,
>
> this is a way to find dupes with sql
>
> SELECT id, year, COUNT(*) AS cnt FROM table
> GROUP BY id, year
> HAVING cnt>1
>
> Lutz
>
>
> joshwhar@cc.usu.edu (J. Wharton) writes:
>
> > Does anyone know of any built-in functions (either in PHP or MySQL) that
can
> > search for duplicates in a table according to 2 fields (id and year)?
> >
> > Thanks in advance,
> >
> > J. Wharton