Hi,
I want to join a table with itself to get all possible combinations of the variable Name in two columns. My first attempt was this:
SELECT P1.Name, P2.Name
FROM Pairs AS P1
INNER JOIN Pairs AS P2
ON P1.Group = P2.Group
WHERE P1.Name <> P2.Name
The thing is that I would also like to eliminate duplicates, i.e. I do not want both the combinations Name1 (in column 1) Name2 in (column 2) and Name2 (in column 1) Name1 (in column 2). One of these rows needs to be eliminated. How do I do this?