I know this is probably a simple question since I'm still learning, but I am trying to find a SQL Select statement that will calculate the SUM of each row's pieces and weight IF their secondary IDs are the same. So the select is collapsing and getting the SUM of rows with the same secondary ID, while also returning the unique rows as well.
ID_a ID_b pieces weight
--------------------------
1 1 10 20
2 1 20 30
3 2 40 40
Will result in
ID_b: 1 pieces: 30 weight: 50
ID_b: 2 pieces: 40 weight: 40
Thank you.