SQL query help...

rlangi05

Member
Joined
Jan 2, 2006
Messages
21
Programming Experience
1-3
Ok.. I have a Items table with the following fields:

ProductCode Value

The ProductCode is not unique and multiple entries of the same product code is allowable.

Now I need, using an sql statement, to display only distinct ProductCode but also the sum Value. I know how to display distinct records using the following sql statement: SELECT DISTINCT ProductCode FROM Items.

So if I have:
ProductCode Value
0001 2
0001 3
0002 1
0002 2
0002 3

I want to show:
ProductCode Value
0001 5
0002 6

Please help.
 
Back
Top