OT: multiple column update statement using subqueries

2004-12-08 Thread Woodchuck
hihi all, my apologies i realize my question is not restricted to struts per se, but i'm hoping to get help from the many experts here... is there an ansi sql compliant way (ie. i'm using jdbc) to update many columns in a table with values from another table without using a subquery for each

Re: OT: multiple column update statement using subqueries

2004-12-08 Thread Jason King
I can't guarantee this is ANSI, but I know it works in Oracle. UPDATE tableA SET (a,b,c) = ( select a,b,c FROM tableB where tableB.key = tableA.key ) Just make sure the select returns the same number of columns as in the set and that the select only returns one row per updated table row.