1

I have table with structure

ID  full_name   Recommended_By  Direction
1   Name1            0             None
2   Name2            1             Left
3   Name3            1             Right
4   Name4            2             Left
5   Name5            3             Left
6   Name6            2             Right

i need to know the count of parent with drown line of all his child example ID ( 1) count is 5 3 left and 2 right

AnandPhadke
  • 13,160
  • 5
  • 26
  • 33
  • 1
    MySQL doesn't support recursive functions, so it is not well suited to the adjacency list model of storing hierarchical data. You ought to consider restructuring your data to use either nested sets or a transitive closure table. See [this answer](http://stackoverflow.com/a/192462/623041) for more information. – eggyal Oct 08 '12 at 11:29
  • any other solution, because i already working in mlm with this structure – Ikrami Hall Oct 08 '12 at 13:18
  • @eggyal The answer you link to says that MySQL 8 supports recursive query in fact. – rlanvin Jan 12 '18 at 20:56
  • @rlanvin: That edit was added three weeks ago. My comment is from over 5 years ago. – eggyal Jan 12 '18 at 21:24
  • @eggyal Oops I have no idea how I missed that. My apologies. – rlanvin Jan 12 '18 at 21:28

0 Answers0