I’m relatively new to coding and have tried searching for a solution, but am not entirely sure how to phrase my question. What would be simplest way to achieve the result I need, as detailed in the example that follows? I’m using MSSQL.
SELECT Unit, Quantity FROM SomeTable WHERE Parameter1 = 'x'
Gives me the result:
Unit | Quantity --------------- a | 10 b | 10 c | 10 a | 10
This is the result I need:
Unit | Quantity --------------- a | 20 b | 10 c | 10
Any help would be greatly appreciated.
Adding a
GROUP BYso do the trick for you.