How to do MySQL Looped Join which tests if results are complete?

后端 未结 2 889
渐次进展
渐次进展 2021-01-17 01:59

Situation:
I have a mysql table of directories. Each directory has a parent directory (stored as parentID), up to the point where the root directory has a parentID of

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-17 02:50

    Well, It could be you did not find a good web example, because you did use the wrong search-term. The problem described fits perfectly into oracles CONNECT BY PRIOR statement and by googling for mysql-equivalents to this statement you find http://explainextended.com/2009/03/17/hierarchical-queries-in-mysql/ quite fast.

    Because its not that easy (and I dont have a mysql-db to rape here) to write this stuff, just have a glance at the good examples given (you can even do that without deployed functions via http://explainextended.com/2009/07/20/hierarchical-data-in-mysql-parents-and-children-in-one-query/.

    If you still dont get the hang of those, I might be able to help at home.

提交回复
热议问题