with
district as
(
select * from SECFUNMODULE where MENUID='030'
union all
select a.* from SECFUNMODULE a, district b
where a.PMENUID = b.MENUID
),
district1 as
(
select a.* from district a where a.MENUID in (select PMENUID from district)
)
select * from district1 order by MENUID
with当然可以实现.
请参照sqlserver2005 的递归查询
http://blog.csdn.net/chenghaibing2008/article/details/8501322
实现很容易,
什么问题可以涉及到两张表递归呢? 具体说说