Lets say we have a table Requests with structure:
user_id
product_id
count
With entries like:
1 1 5
1 2 6
1 1 3
2 1 7
2 1 3
2 2 5
I want to count how much of each product each user has.
And get output like this:
1 1 8
1 2 6
2 1 10
2 2 5