Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Add values from multiple rows and columns from two tables... SQL newbie

$
0
0

Hello!

I'm a bit of a SQL noob but I'm trying to create a SQL script that can do the following:

Add integer values from TableA > Columns 2,3,4,5 and 6 and rows 1-7 and add them against the exact same cell in TableB

Tables A and B are exactly the same. One is told daily numeric stats and one is to hold weekly stats.

So what I am after is a way to insert the data from TableA while simply adding to the existing values in TableB and then a SPROC will truncate the data at the end of the week.

Any ideas on how I can achieve this? I appreciate I may be writing a long winded sql query on this one

Thanks!


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>