查询部门下的所有员工以及子部门

部门 01
A部门 01_A
B部门 01_B
B部门下的A部门_01_B_A
查询所有的部门以及子部门
select t.name from sys_depts t where t.pid like '0_1%'  在和用户相关联
select t.name,u.id from sys_depts t,sys_users u where t.pid like '0_1%' and u.dept_id=t.id
posted @ 2013-07-26 19:05  宝贝,我永远都在  阅读(1686)  评论(0)    收藏  举报