Solved

Need query

Posted on 2011-03-01
5
300 Views
Last Modified: 2012-05-11
Please find attachment.
Thanks in advance
0
Comment
Question by:kirannandedkar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 

Author Comment

by:kirannandedkar
ID: 35008155
Sorry forgot the attachment
Table-A.doc
0
 
LVL 25

Accepted Solution

by:
reb73 earned 250 total points
ID: 35008269
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
ID: 35012041
Have you tried doing it
0
 

Author Comment

by:kirannandedkar
ID: 35015048
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
ID: 35350989
It was nice query and it helped me
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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

733 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