with recursive r as(
select * from SYS_CODE where 1=1
AND id = #{id}
union all
select c.* from SYS_CODE c,r where r.ID = c.PID
)select r.* from r order by r.ID
sql 递归查询
最新推荐文章于 2023-01-06 09:12:18 发布
with recursive r as(
select * from SYS_CODE where 1=1
AND id = #{id}
union all
select c.* from SYS_CODE c,r where r.ID = c.PID
)select r.* from r order by r.ID