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.
Woodchuck wrote:
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 column being updated?
ie. i want to avoid this:
update tableA set a = (select...), b = (select...), c = (select...) where id = 1
each column is being updated from the same other table (it would be same record in fact), not from many other different tables.
surely, someone has faced this situation? i hope?
please and thanks, woodchuck
__________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]