distal-attribute
distal-attribute
distal-attribute
distal-attribute

How to update or add to table1 where email = table2.email?

westmatrix posted 6 years ago in General
How to update or add to table1 where email = table2.email?

UPDATE 'table1' SET 'field1' WHERE 'email' = 'table2.email'



I don't think this is at all right but can't update or add data from new table?

Cheers
ansgar posted 6 years ago
Try this:

ALTER TABLE table1 ADD field1 VARCHAR(255);
UPDATE table1 AS t1, table2 AS t2 SET t1.field1=t2.field1 WHERE t1.email = t2.email;

westmatrix posted 6 years ago
Wow that's amazing! happy

Thank you! :)

Please login to leave a reply, or register at first.