Link to home
Create AccountLog in
Avatar of erp1022
erp1022Flag for United States of America

asked on

sum similar in SQl

Hello,

I have a bunch of products that I'd like to sum the sale value of. For example:

Product ID    Sale Value
CM456           100.00
MA333           200.00
MA334           150.00
MA335           175.00
MT001           200.00
etc.

I know how to do sum in my select statement and then group by the Product ID field. But what I would also like to do is to group all of the MA's together so that there is only one line for them.

So my report would look like:
CM     $100.00
MA     $525.00
MT     $200.00

(I know how to use the substring function also, to get the two leading alpha characters.)

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of erp1022

ASKER

Thank You!!