happyqiang
1  with cte as 
2  ( 
3  select a.DepartCode,a.DepartName,a.ParentDepartCode from tbDeparts a where ParentDepartCode=\'2\' 
4  union all  
5  select k.DepartCode,k.DepartName,k.ParentDepartCode  from tbDeparts k inner join cte c 
6  on c.DepartCode = k.ParentDepartCode 
7  )
8  select * from cte 

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-08-10
  • 2022-02-17
  • 2021-12-26
  • 2021-11-13
  • 2021-12-09
相关资源
相似解决方案