Imagine this was the table:
Code: Select all
row_id | user_id | count
---------+-------------+----------
1 | 1 | 10
2 | 2 | 5
3 | 3 | 2
4 | 1 | 4
5 | 1 | 6
6 | 2 | 1