nick轩

导航

SQL Server查找一棵树


WITH ModuleInfo AS(
select * from Base_Module where Code='HRAdmin'
UNION ALL
select a.* from Base_Module AS a,ModuleInfo AS b WHERE a.parentid = b.id and a.Enabled=1 and a.DeletionStateCode=0
)
SELECT * FROM ModuleInfo
order by SortCode

posted on 2012-02-27 15:22  nick轩  阅读(228)  评论(0编辑  收藏  举报