I still have plenty to learn about SQL... I'm pretty sure what I want to do is possible, but I'm getting lost in the syntax.
I have two tables:
TABLE A: [ID] [Name]
TABLE B: [ID] [TableA.ID] [intValue] [intTypeID]
There are 3 pieces of information I want:
Sum(TableB.intValue) WHERE intTypeID = 1
Sum(TableB.intValue) WHERE intTypeID = 2
Getting one of those pieces is simple: SELECT a.ID,a.Name,SUM(b.intValue) WHERE a.ID = x GROUP BY a.ID,a.Name
I assume I need some kind of JOIN, but I can't seem to get it... any ideas?
View Complete Post