I have a table like that:
_id sender_id receiver_id text
1 1 2 xxx
2 2 1 yyy
3 1 2 xyz
4 3 1 abc
I need to do a GROUP BY on both the sender_id
and receiver_id
columns, but it should be symmetric, so {1,2} and {2,1} should be considered as the same group.
This query could be executed on a random DBMS so it should be as most standard as possible.