I have a table with users in mysql. users:
+---+-------+
| id| name |
|---+-------+
| 1 | john |
| 2 | david |
| 3 | paul |
+---+-------+
What I want is a table with relations of all users like this (it's like a matrix in a listform):
1|2
1|3
2|1
2|3
3|1
3|2
Which query will result in the desired table? an how can i keep it updated when i will add a user?
Many thanks in advance!
ps. Eventually i want to use it to store the degree of separation between users with the help of a relations table Table with 3 levels of degree of separation. I'm not really sure if this is a step in the right direction...