- 博客(1)
- 资源 (1)
- 收藏
- 关注
原创 查询所有子节点
select t1.id, if(find_in_set(父级id字段名, @pids) > 0, @pids := concat(@pids, ',', 主键id字段名), -1) as ischild from ( select 主键id字段名,父级id字段名 from 表名 t order by 父级id字段名, 主键id字段名 ) t1, (select @pids := 需要查询的主键id) t2 ) t3 where ischild!
2022-09-16 16:12:53
324
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人