Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Update Table1 From Table2


Demaestro - 7:42 pm on Nov 9, 2010 (gmt 0)


What DB are you using?

I think MySql doesn't support update/selects

but what you want is

UPDATE Table1 tbl1, Table2 tbl2
SET tbl1.a = tbl2.a, tbl1.b = tbl2.b, and so on

WHERE tbl1.id = tbl2.id


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4228501.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com