阅读背景:

mysql中不用存储过程和函数查询子节点的方法

来源:互联网 

sql实现:

select id from (
              select t1.id,
              if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischild
              from (
                   select id,parent_id from re_menu t where t.status = 1 order by parent_id, id
                  ) t1,
                  (select @pids := 要查询的菜单节点 id) t2
             ) t3 where ischild != 0select id from (
              



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: