troubleshooting Question

SQL Group by and SUM question

Avatar of lagrottan
lagrottan asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008SQL
16 Comments1 Solution387 ViewsLast Modified:
Greetings Gurus,
I am trying to figure out how to link 2 tables in a 1 to many relationship, but show the sum of the many side.  
Here is an illustration;

Table1                       Table2        
   ColumnA                ColumnA     ColumnB
     group1                    group1        5
     group1                    group1        4
     groug1                    group1        1

output I am looking to produce
ColumnA    ColumnB
   Group1      10 ------>(5+4+1)
   Group1      10
   Group1      10
Let me know if this does not make sense.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 16 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros