Hello,
I have the follow table named A:
Code:
id  medicine
1   1
1   2
1   3
i wish to get the pairs of drugs that belong to the same id , for example:
Code:
medicine1 medicine2
1         2
1         3
2         3
i try to do this with this query:
Code:
select a1.medicine as medicine1, a2.medicine  as medicine2 
from  A  a1 inner join A  a2  on a1.id = a2.id
...