I do that a lot using Microsoft Access. I just finished on a project where I 
had to eliminate duplicates from each of three or more queries, a couple of 
which have three keys. However I am not much more experienced han you are; 
Microsoft Access generates SQL for us so I am not sure what the SQL looks 
like.

This is actually a SQL question; I think it can be solved entirely by SQL. 
However I don't know and it is not my responsibility to decide such things.

You can (should) sort by email address of course. Then there is a function 
for getting the count of a field. The result will be records with the email 
address occuring only once. The following I think is a simplified version of 
something I have done:

SELECT ITEMNO, COMP1, COMP2, Count(COMP2) AS CountOfCOMP2 FROM CostsMerge 
GROUP BY ITEMNO, COMP1, COMP2;

However I have another duplicates removal query that uses "Last" but not 
"Count", as in:

SELECT Item, Comp1, Comp2, Last(Comp1Q), Last(Comp2Q) INTO MergedData FROM 
Merge GROUP BY ITEMNO, COMP 1, COMP 2;

In both of the above, there are three keys: Item, Comp1 and Comp2; whereas 
you have just one key, the email address.


"Dustin Krysak" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi there - I have an extremely simple table that has a unique Id and an 
> email address..... what I am looking for is an example of a PHP script 
> that will poll the MYSQL database and delete the duplicate records leaving 
> only 1 unique (email) record.
>
> can someone point me to the right place?
>
> thanks!
>
> d 

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

Reply via email to