父子关系展示

mac2022-06-30  118

--1、

select t1.deptno, t1.dname, t2.empno, t2.ename, t2.mgr  from dept t1  left join emp t2    on t1.deptno = t2.deptno order by t1.deptno, t2.empno;

 

--2、

select t2.empno employer_no,       t2.ename employer_name,       t1.empno employee_no,       t1.ename employee_name  from emp t1  left join emp t2    on t2.empno in t1.mgr;

 

转载于:https://www.cnblogs.com/iyoume2008/p/7133430.html

相关资源:根据文件列表构建树形结构的父子关系源码
最新回复(0)