你的位置:首页 > ASP.net教程

[ASP.net教程]sql server根据一级分类查询所有子级分类

1 WITH a AS2  (3   SELECT * FROM dbo.db_UserGroup WHERE TB_UserGroupID=14   UNION ALL SELECT s.* FROM dbo.db_UserGroup AS s,a WHERE s.FK_ParentId=a.TB_UserGroupID5 )6 SELECT * FROM a