I have a script that's supposed to update table1's email_id column to match table2's id column wherever the email address in table1 matches an address in table2. It works when I run it on one CSV (with data exported from SalesForce), but not on data in other CSVs exported in the same way one day later.
This is the script:
UPDATE cdata_assignments, email_addresses
SET cdata_assignments.email_id = email_addresses.id
WHERE cdata_assignments.email = email_addresses.email_address
I've narrowed the problem down to the cdata_assignments.email field. It looks fine in phpmyadmin (all the entries look like normal email addresses), but scripts don't seem to recognize the entries. Again, this is the same data, exported using the same report template in SalesForce, and it works fine on a CSV exported yesterday, but it won't work on new CSVs today.
The script, and the one Alex suggested below, both work fine on some CSVs. But on others that contain data that should be formatted identically, they don't seem to recognize cdata_assignments.email as a field that can be matched.