Try this:
Main Topics
Browse All TopicsIts a simple question for you all except me
I have two table. A, B
In A I have following records
Column 1, Column 2, Column 3
2 , 2 , 5
7 , 3 , 6
2 , 6 , 9
Similarly I have Table B as follows
Column 1, Column 2, Column 3
2 , 2 , 4
7 , 3 , 6
2 , 6 , 2
So I need to run query. That will take column1 and column 2 as the key in both the tables. and I have to add column 3 of Table B from column 3 of Table A by using the same Key (Column 1 and 2).
So my final result will be.
Column 1, Column 2, Column 3
2 , 2 , 9
7 , 3 , 12
2 , 6 , 11
I need the query for this.
But I dont want to use Cursors or any procedures.
I need the single query to do this.
Also If you use merge is also ok.
Thanks for your help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Sorry for continuing.
The update query is updating all the records in the table. If there is no key combination found, then also it is updating the existing value to null.
Now I am using NVL function to retain the same values again.
But My table is huge about 2 crore. So its updating all the records.
It reduces the performance of the query.
So I need to update only matching records.
Business Accounts
Answer for Membership
by: sdstuberPosted on 2009-11-03 at 05:56:26ID: 25728915
select a.col1, a.col2, a.col3 + b.col3
from a, b
where a.col1 = b.col1
and a.col2 = b.col2