Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Merge statement - update multiple columns from a single sub-select

user565033May 28 2009 — edited May 28 2009
Is it possible to write in 10gR2, a MERGE statement, with UPDATE for multiple columns from a single sub_select?

like this:
MERGE INTO tableA
using ( select * from temp) tmp
on( tableA. col1 = tmp.col1)
when matched then
update set  ( tableA.col5,
                   tableA.col6, 
                   tableA.col7) = ( select sum(col2), sum(col3), sum(col5)
                                                                             from tableX 
                                                                            where tableX.col1 = tableA.col1...)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2009
Added on May 28 2009
6 comments
17,891 views