日期:2014-05-17 浏览次数:20871 次
id name parentId
1 总部 0
2 财务 1
3 审计 2
4 信息 1
5 内审 1
select * from s_room where parentid in(select id from s_room where parentid in ( select id from s_room where name='总部'))
or id in (select id from s_room where parentid in ( select id from s_room where name='总部')) or c_name='总部';
SELECT *
FROM S_ROOM D
CONNECT BY PRIOR D.ID = D.PARENTID
START WITH D.NAME = '财务'