List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:August 18 1999 4:18pm
Subject:Re: Finding duplicate records
View as plain text  
On Wed, 1999-08-18 15:25:41 +0200, Richard Ellerbrock wrote:
> Is there a way to display all duplicate records in a table other
> than to GROUP BY into a temporary table and to then join back to the
> original table? Note that having duplicates in my table is totally
> legitimate, except that I want a quick way to find them!

  SELECT field1, field2, ...
  FROM   tablename
  GROUP BY field1, field2, ...
  HAVING COUNT(*) > 1;

with "field1, field2, ..." being the list of fields which should
make up an unique combination.

How does your method using a temporary table look like?

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
Finding duplicate recordsRichard Ellerbrock18 Aug
  • Re: Finding duplicate recordsMartin Ramsch18 Aug
  • Re: Finding duplicate recordssasha18 Aug
  • Re: Finding duplicate recordsColin McKinnon18 Aug
Re: Finding duplicate recordsRichard Ellerbrock19 Aug
  • Re: Finding duplicate recordsMartin Ramsch20 Aug
    • Re: Finding duplicate recordsBenjamin Pflugmann20 Aug
Re: Finding duplicate recordsAndrey Muratov19 Aug
Re: Finding duplicate recordsAndrey Muratov19 Aug