Hierarchical Data - Nested Set Model: MySql

前端 未结 4 985
不知归路
不知归路 2020-12-16 19:18

I am just learning how to implement the Nested Set Model but still have confusion with a certain aspect of it involving items that may be part of multiple categories. Given

4条回答
  •  佛祖请我去吃肉
    2020-12-16 19:43

    Nested set model is a structure for 1:N (one-to-many) relationships, you want to use M:N (many to many) relationship (many items can have apple as parent, but can have more than one parent).

    See this article

    Wikipedia

    But you should be aware, that hierarchical M:N relationships can get quite complex really fast!

提交回复
热议问题