I have a table of this format
RELATIONS
-----------------
ID | ID_1 | ID_2
All in INT and ID
is auto incremental.
It is filled in this way:
ID | ID_1 | ID_2
-----------------
1 | 1 | 5
-----------------
2 | 5 | 1
-----------------
3 | 1 | 3
-----------------
4 | 3 | 6
-----------------
5 | 6 | 3
-----------------
Have you noticed that there are interlaced IDS? The 1
and the 5
are connected on both the first and second paths, 3
and 6
also but 1
and 3
no, because the connections are not mutual ..
How to get the interleaves (which are mutual on the first and second path) of the id number 6
? or 5
, or 1
?
For example, I want to get the ID of the interleaving of ID 6
ID_PROCURADO | ENTRELAÇADO
---------------------------
6 | 3