Did you mention cofee John? now why did i suggest subselects when good old joins seem to do the tricks. Yikes!

John W. Holmes wrote:

From: "Chris Bruce" <[EMAIL PROTECTED]>



I am trying to write a function that would compare one table to a
number of other tables in Mysql and remove any duplicates found. This
is for tables of email addresses where I want to remove any dups found.

Example:
Master list - compare to list1, list2, list3, and so on and remove
matches found from list1, list2, list3 etc. *not* from Master list.

Does anyone know of any such beast before I set out to reinvent it?



DELETE FROM list1 USING master_list, list1 WHERE list1.email = master_list.email

Repeat for other tables.

---John Holmes...





--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

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



Reply via email to