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

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

User, date Message
Written by westmatrix
6 years ago
Category: General
82 posts since Wed, 11 Apr 07
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
Written by ansgar
6 years ago
4800 posts since Fri, 07 Apr 06
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;

Written by westmatrix
6 years ago
82 posts since Wed, 11 Apr 07
Wow that's amazing! happy

Thank you! :)
 

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