Articles & Code Snippets


Compare tables find and update in MySQL

Compare two tables find and update only matching data in MySQL


Find:
SELECT id, mailing 
FROM directory_list a 
JOIN email_temp b ON a.email=b.email;
Update:
UPDATE directory_list a 
JOIN email_temp b ON a.email=b.email 
SET mailing = concat(COALESCE(mailing, ''), ' --text--');
web


Archives