Query for duplicate records

Query for duplicate records

am 17.10.2010 21:55:45 von ron.piggott

------=_NextPart_000_007F_01CB6E13.C2488E40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Is there a query you could help me write a SELECT query that would =
search table `ministry_profiles` for where column `organization` has =
the same organization more than once? I am trying to delete the =
duplicate organization records, but I am working with 1,000+ businesses =
and I can't go through each record looking for duplicates.=20

------=_NextPart_000_007F_01CB6E13.C2488E40--

Re: Query for duplicate records

am 18.10.2010 00:14:00 von dmagick

On 18/10/10 06:55, Ron Piggott wrote:
> Is there a query you could help me write a SELECT query that would search table `ministry_profiles` for where column `organization` has the same organization more than once? I am trying to delete the duplicate organization records, but I am working with 1,000+ businesses and I can't go through each record looking for duplicates.

select organization, count(*) from ministry_profiles group by
organization having count(*) > 1;

gives you which organization has more than 1 account (and how many
duplicates you are dealing with).

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php