SQL——While循环

while循环。

通过循环计数,得到了子节点,在树中的层数。

建表的约定:Id是节点Id;ParentId是父节点的Id;根节点的ParentId值为‘0’。

原文地址:https://www.cnblogs.com/fabao/p/12964461.html