0

In mysql, if you have 2 people that aren't "friends" with each other, but they are friends of friends of friends of friends, how would you go about finding how they are connected?

What if they are connected in more paths that one?

I was going to put a DB diagram on here. But it might not be the right design to answer this question.

I found this: Degrees of Separation Query But I'm not sure that answers the question?

Thanks!

Community
  • 1
  • 1
Chemdream
  • 618
  • 2
  • 9
  • 25

1 Answers1

-1

That is why I do not like MySQL. Recursive CTE are not supperted there. If we had MS SQL database, we could easily do such a thing using CTE. What I recommend is looking google for the following: "CTE in MySQL". I did it for you trying to help you, we had a few similar questions on stack overflow, and I think these answers are helpful.

How to transform a MSSQL CTE query to MySQL?

Generating Depth based tree from Hierarchical Data in MySQL (no CTEs)

Community
  • 1
  • 1
user3162968
  • 1,016
  • 1
  • 9
  • 16