Hi, The following table is from a database:
Col1 Col2 Al Ibrahim Al Bob Al Chuck Al Frank Bob Gary Bob Doug Chuck Doug Chuck Ed Chuck Frank Doug Hamza Gary Ibrahim Gary Hamza This is the above representation of all connections/links/friendship o +f each friend: Al--------Frank /|\ | / | \ | / | \ | / | \ | / | \ | Ibrahim Bob Chuck \ /| / | \ / | / | \ / | / | Gary Doug Ed \ / \ / \ / Hamza
I use SELECT (through recursion) to figure out a friend's friends and their friends, it works fine. I am wondering if there is a way (without using recursion-as it causes too much overhead) to be able to figure out who are, say, "AL" 's friends and inturn their friends. In other words, I need to determine how to find a friend's all the friends and their friends(friend of a friend of a friend and so on) without using recursion. I also did some search on sql and "adjacency list" but didn't find much helpful.
Any help is highly appreciated. Thanks
In reply to sql adjacency list by boulevard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |