RE: [PHP-DB] UPDATE table1 FROM table2

From: Date: Fri, 02 Nov 2001 11:29:14 +0000
Subject: RE: [PHP-DB] UPDATE table1 FROM table2
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-13931@lists.php.net to get a copy of this message
Yes, it is possible: UPDATE TABLE2 SET (Field1, Field2, Field3) SELECT UpdaterField1, UpdaterField2, UpdaterField3 FROM TABLE1 WHERE SomeField LIKE 'Something' WHERE SomeField LIKE 'Something' That should work. Manual tells you more in Update section. Niklas -----Original Message----- From: m0sh3 [mailto:m0sh3@hotmail.com] Sent: 2. marraskuuta 2001 13:15 To: php-db@lists.php.net Subject: [PHP-DB] UPDATE table1 FROM table2 In MySQL 3.23, how to update one table using information from another table. update table1 set value1=t2.value2 from table1 as t inner join table2 as t1 using(pk_key) ??? or update table1 as t1 inner join table2 as t2 using(pk_key) set t1.value1=t2.value2 ??? Is it possible at all? Thank you -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#13931) next »