How do I combine two rows of same part, but add quantities?

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-04-12T22:31:51Z Indexed on 2010/04/12 22:32 UTC
Read the original article Hit count: 153

Filed under:
|
|
|
|

I have table "PICKITEM"

PARTID      QTY
A           1
A           3
B           11
C           8
D           5
D           3

I need a select statement that will return one line for like PARTIDs and add the qty field to together, yet also return the rest of the lines in the table as is

PARTID      QTY
A           4
B           11
C           8
D           8

Probably a newb question, but I am new to SQL syntax and queries. Any help in getting me on the right path would be appreciated!

© Stack Overflow or respective owner

Related posts about sql

Related posts about join