Summing/Joining data

  • Thread starter Thread starter JB
  • Start date Start date
J

JB

I have a query where if you give the code(Ex: BA1) it
brings up matching descriptions and the price for each of
them.

Code Description Price
BA1 AAA $0.11
BA1 BBB $0.22
BA2 AAA $0.11


Is there anyway I can create a query that will give me
result like below?

Code Description Price
BA1 AAA + BBB $0.33
BA2 AAA $0.11

Is there a way to do this?

Thanks.
 
Well, getting the Description field to look like you want it could be
something of a pain, but the rest would work like this:

SELECT Code, Sum(Price)
FROM YourTable
GROUP BY Code;
 
Back
Top