![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递归查询
wjy550823795
这个作者很懒,什么都没留下…
展开
-
递归查询树tree 根据子节点查询父级
根据父节点查询子集https://blog.csdn.net/wjy550823795/article/details/100703615 表结构就是正常的id 与 父类id 如上链接所示 SELECT T1.LEVEL1,T2.* FROM ( SELECT @r AS _id, (SELECT @r := parent_id FROM pr...原创 2019-09-20 16:12:05 · 2298 阅读 · 1 评论 -
递归查询树tree 根据父节点查询子集
表结构 SELECT ID.LEVEL1, DATA1.* FROM ( SELECT @ids AS _ids, ( SELECT @ids := GROUP_CONCAT( pid ) FROM project_grouping WHERE FIND_IN_SET( parent_id, @ids ) ) AS cids, @l := @l + 1 AS LEVEL1 ...原创 2019-09-10 16:36:14 · 1638 阅读 · 0 评论