[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multi-table update


I'm wondering what is the best way to update one table based on another.  Can joins be performed for an update?

update table1 set table1.field2 = table2.field2 where table1.field1 = table2.field1;

The alternative seams to be:
select table2.field2 from table2;
update table2 set table2.field2 = $savedValue;

which is very slow....

Thanks.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread92867@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.