sql查询分类和所有子类
select * from [JianDu].[dbo].[ZuZhiJiGou] where id = 64 --查询节点
union all
SELECT TOP 1000 a.*
FROM [JianDu].[dbo].[ZuZhiJiGou] a join [JianDu].[dbo].[ZuZhiJiGou] b on a.pId = b.id
where a.Pid = 64
select * from [JianDu].[dbo].[ZuZhiJiGou] where id = 64 --查询节点
union all
SELECT TOP 1000 a.*
FROM [JianDu].[dbo].[ZuZhiJiGou] a join [JianDu].[dbo].[ZuZhiJiGou] b on a.pId = b.id
where a.Pid = 64