I have a table that shows the relationships between people a bit like this.
id linked_id
1 2
1 3
3 4
4 1
There is no apparent order to the table or the relationships.
I’m trying to find a way to list all the ids that have any kind of link to a given id. So for examples from the table above:
id = 1 would return 1, 2, 3 and 4.
id = 2 would also return 1, 2, 3 and 4
It’s an oracle database, and the query would have to be in plain SQL. Thanks for your help, this has been driving me nuts.
You could use something like this: