日期:2014-05-17 浏览次数:20768 次
SELECT e1.ename, e2.ename mgr_name
FROM (SELECT ename, empno
FROM emp) e2, emp e1
WHERE e2.empno = e1.mgr
ORDER BY e1.ename;
SELECT e1.ename,
(SELECT ename mgr_name
FROM emp
WHERE empno = e1.mgr)
FROM emp e1
ORDER BY e1.ename;
SELECT e1.ename, e2.ename mgr_name
FROM (SELECT ename, empno
FROM emp) e2, emp e1
WHERE e2.empno = e1.mgr
ORDER BY e1.ename;
SELECT e1.ename,
(SELECT ename mgr_name
FROM emp
WHERE empno = e1.mgr)
FROM emp e1
ORDER BY e1.ename;