1.Oracle递归查询

oracle/sqlserver 递归

 2.SqlServer递归查询

oracle/sqlserver 递归
 with cte as 
 ( 
 select t.id,t.name,t.parentId from dbo.Department t where t.id='2' 
 union all  
 select k.id,k.name,k.parentId  from dbo.Department k inner join cte c on c.id = k.parentId 
 )select * from cte 
oracle/sqlserver 递归

 转自:http://www.cnblogs.com/hesheng/archive/2012/08/09/2630708.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-06-19
  • 2021-09-06
相关资源
相似解决方案