Re: Query for duplicate records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux