标签:
--通过父节点查询子节点 WITH TREE AS( SELECT * FROM Role WHERE RoleID = 4 -- 要查询的父 id UNION ALL SELECT Role.* FROM Role, TREE WHERE Role.ParentRoleID = TREE.RoleID ) SELECT * FROM TREE
递归查询子类sql
原文地址:http://www.cnblogs.com/wln3344/p/4252486.html