Corey Kaye writes: > 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. >
This feature will come in 4.0.2, with a different syntax: UPDATE join_table_list SET ... WHERE ... -- Regards, __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus <___/ www.mysql.com --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php