What is the shortest or fastest SQL select query or SQL procedure to crawl a social graph. Imagine we have this table:
UId FriendId 1 2 2 1 2 4 1 3 5
So you want get all friends of someone, including n-th degree friends? I don't think it is possible without recursion.
How you can do that is explained here: https://inviqa.com/blog/graphs-database-sql-meets-social-network