SQL Server 根据一级分类查询所有子级分类
WITH a AS ( SELECT * FROM view_SubjectList WHERE id=1 UNION ALL SELECT s.* FROM view_SubjectList AS s,a WHERE s.pId=a.ID ) SELECT * FROM a
WITH a AS ( SELECT * FROM view_SubjectList WHERE id=1 UNION ALL SELECT s.* FROM view_SubjectList AS s,a WHERE s.pId=a.ID ) SELECT * FROM a