Topic
  • 1 reply
  • Latest Post - ‏2008-01-22T19:25:57Z by Stan
SystemAdmin
SystemAdmin
1525 Posts

Pinned topic Need help with UPDATE of table with multiple columns from another table

‏2008-01-11T05:51:02Z |
Hi,
is it possible to realise something like that
without fetching every row from YYY
?
UPDATE XXX t_u
set (col1, col2, col3)
= (select col_n1,col_n2,col_n3
from YYY t_n
where t_n.id = t_u.id).

UPDATE XXX t_u
set col1
= (select col_n1
from XXX t_n
where t_n.id = t_u.id),
col2
= (select col_n2
from XXX t_n
where t_n.id = t_u.id)
is to slowly.
I would prefer to use merge,
but it is not supported by Cloudscape.

Regards
Denis
Updated on 2008-01-22T19:25:57Z at 2008-01-22T19:25:57Z by Stan
  • Stan
    Stan
    267 Posts

    Re: Need help with UPDATE of table with multiple columns from another table

    ‏2008-01-22T19:25:57Z  
    I can't think of a way to do this and agree it would be helpful. I did a quick check and did not find a this feature yet requested. Would you file a feature request for this in JIRA? The instructions for doing this is found at: http://db.apache.org/derby/DerbyBugGuidelines.html