I need to constract an SQL query but I have no idea how to do it. If someone helps, I'll appriciate it very much.
I have the following table
GroupedBYField ConditionField ToBeSummeField
1 1 1
1 1 2
1 1 3
2 2 100
2 2 200
2 2 300
and I need to get all the possible combinations of groupedBYField, SUM(ToBeSummeField)
which has
SUM(conditionField) = 2
, that is the following table
GroupedBYField SumField
1 3
1 4
1 5
2 100
2 200
2 300
Thank you for your help!