SSH中hibernate查询
如何根据员工查询员工所在部门经理的信息 hibernate java web
[解决办法]
select * from sys_employee t where t.sn in (
select t1.manager_sn from sys_department t1 where t1.ID = (
select t2.department_id from sys_employee t2 where t2.sn = 要查询的员工编号
)
)
[解决办法]
select dep.manager_sn from sys_department dep where dep.id = (
select emp.department_id from sys_employee emp where emp.sn = '查询的员工号'
)