Re: MYSQL-Search for duplicates
| From: | (Lutz Brückner) | Date: | Mon, 06 May 2002 19:20:24 +0000 |
| Subject: | Re: MYSQL-Search for duplicates | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18986@lists.php.net to get a copy of this message | ||
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