Home > database >  How to design the higher and lower the infinite of members in the table?
How to design the higher and lower the infinite of members in the table?

Time:09-24

Usually we design the member table hierarchy is
Tb_user
Id, username, parentId
In direct sales system project, the member level supervisor is infinite, then want to look up a member of the team members (including the lower, under the lower down the lower... ) can't do the query,
so the question comes, this kind of situation is how to design a database table?

CodePudding user response:

This design can query, need to use a recursive query, look at this example
https://www.cnblogs.com/xiaoxi/p/5942805.html

CodePudding user response:

https://blog.csdn.net/ACMAIN_CHM/article/details/4142971
  • Related