Finding duplicates across tables
Posted: Mon Apr 05, 2010 3:56 pm
I have 75 MySQL tables with identical structure, from various email signup forms. Many of them duplicate data from other tables -- there are 70,000 email addresses, but only about 21,000 different ones.
I only really care about the "email" field. How can I most efficiently (using PHP) determine which tables have the same emails?
For example, I want to find that "something@example.com" is in Table 1, Table 6, Table 17, and Table 23.
I've already created a master list with no duplicates, but I need to find out where the redundancy is and clean it up.
(And for the record, I didn't create this mess. The client is coming to us from another company.)
I only really care about the "email" field. How can I most efficiently (using PHP) determine which tables have the same emails?
For example, I want to find that "something@example.com" is in Table 1, Table 6, Table 17, and Table 23.
I've already created a master list with no duplicates, but I need to find out where the redundancy is and clean it up.
(And for the record, I didn't create this mess. The client is coming to us from another company.)