Hacker News new | past | comments | ask | show | jobs | submit login

Confused, why can't you just do something like this?

  SELECT name FROM user
  CROSS JOIN friend ON id2 = user.id
  GROUP BY id2 HAVING COUNT(id2) = 4



That can only query for a depth of 1. It doesn't let you query for friends of friends at an arbitrary depth.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: