Solved

Need query

Posted on 2011-03-01
5
250 Views
Last Modified: 2012-05-11
Please find attachment.
Thanks in advance
0
Comment
Question by:kirannandedkar
  • 4
5 Comments
 

Author Comment

by:kirannandedkar
Comment Utility
Sorry forgot the attachment
Table-A.doc
0
 
LVL 25

Accepted Solution

by:
reb73 earned 250 total points
Comment Utility
Something like this, perhaps?
Update Table_D
SET TotalAmountBase = ISNULL(A.SumBase,0) + ISNULL(B.SumBase, 0)
FROM Table_D D
LEFT JOIN (SELECT LogId, Sum(amountBase) as SumBase FROM Table_A Group By LogId) A ON A.LogId = D.LogId
LEFT JOIN (SELECT LogId, Sum(amountBase) as SumBase FROM Table_B Group By LogId) B ON B.LogId = D.LogId

Open in new window

0
 

Author Comment

by:kirannandedkar
Comment Utility
Have you tried doing it
0
 

Author Comment

by:kirannandedkar
Comment Utility
Really really thanks.. I hope there is no performance issue.. If you have better query than this then pls let me know otherwise i will close the question and award you points
0
 

Author Closing Comment

by:kirannandedkar
Comment Utility
It was nice query and it helped me
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now