Summing/Joining data

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.
 
L

Lynn Trapp

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top