2005以上可以使用cte来递归了 效率还可以 ;with f as ( select * from tb where id=@id union all select a.* from tb a join f b on a.id=b.ParentID ) select * from f
27,579
社区成员
68,557
社区内容
加载中
试试用AI创作助手写篇文章吧