MySQL - Recursing a tree structure

后端 未结 3 796
温柔的废话
温柔的废话 2020-12-01 16:52

I have a database table which link locations together; a location can be in a location, which can be inside another location.

location (, ....)
loc         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 17:35

    There's a good-looking article over at mysql.com outlining various ways of managing hierarchical data. I think it provides a full solution to your question, and shows various less simple, but faster approaches (e.g. Nested Sets).

提交回复
热议问题