in access i have this table like so:
MyTable:
ID,Autonumber
Name,Text
ID Name
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
10 J
I have this self join like so:
Code:
SELECT T1.ID, T2.ID
FROM MyTable AS T1, MyTable AS T2
WHERE T1.ID<>T2.ID;
result:
T1.ID T2.ID
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
1 2
and so on ....
the problem is this result has duplicate combinations of T1.ID and T2.ID like so:
T1.ID T2.ID
2 1
1 2
3 1
1 3
and so on ....
i can remove these duplicates by looping trough the result and removing the duplicates
but i wonder if there is not a method to have the query not return these duplicates ?