Let's say I have the following query
Select user_id, item_id
from some_table
And your result is this
10,20
10,21
10,22
10,23
10,24
11,30
11,31
11,32
11,33
11,34
What I really want is to only have 2 friend per each user, the following would be the desired output
10,20
10,21
11,30
11,31
How do you modify the query above to work this way without nested queries?