MSSQL 经典SQL 语句--WITH递归
with pb1 as ( select c.id, c.pid, c.pname, c.peopletype, c.ptype from sys_pbinstance c with(nolock) ) , pb2 as ( select * from pb1 where id='2031ec0f-cfaa-5cbe-230c-04d1939354d3' union all select pb1.* from pb2 inner join pb1 on pb2.id=pb1.PID ) select * from pb2