duplicate column name
select e.empno,e.deptno,e.ename,d.ename from emp e,emp d where e.mgr=d.empno and e.hiredate<d.hiredate;
EMPNO DEPTNO ENAME ENAME
---------- ---------- ---------- ----------
7499 30 ALLEN BLAKE
7521 30 WARD BLAKE
7698 30 BLAKE KING
7566 20 JONES KING
7782 10 CLARK KING
7369 20 SMITH FORD
6 rows selected.
SQL> create table empa as select e.empno,e.deptno,e.ename,d.ename from emp e,emp d where e.mgr=d.empno and e.hiredate<d.hiredate;
create table empa as select e.empno,e.deptno,e.ename,d.ename from emp e,emp d where e.mgr=d.empno and e.hiredate<d.hiredate
*
ERROR at line 1:
ORA-00957: duplicate column name
------解决方案--------------------
提示比较明显了,就是列名重复。
如楼主的做法,起不同的别名就OK了