开发者

SQLite and hierarchy in one request, how to do so?

开发者 https://www.devze.com 2023-01-04 21:37 出处:网络
Facts I have a pretty simple table: ID, name, PARENT_ID I would like to retrieve the hierarchy from down to top in one query using SQLite.

Facts

I have a pretty simple table:

ID, name, PARENT_ID

I would like to retrieve the hierarchy from down to top in one query using SQLite.

Question : How can I do that ?

Is there any request that will let me do that in One request?

I´ve read about the 'Modified Preorder Tree Traversal', it开发者_高级运维 is straight forward to get the hierarchy from top to down, but how can I get it from down to top (in one query)?


There is no way to do a closure query in SQLite.

0

精彩评论

暂无评论...
验证码 换一张
取 消