以下查询无法解析:
select t.ename, t.received, d.loc from
(
select e.ename, eb.received , e.deptno
from emp e left outer join emp_bonus eb
on
e.empno=eb.empno
)
as t
join dept as d on d.deptno = t.deptno;
错误:
字段列表中的列'deptno'不明确
但此查询已成功解析:
select t.ename, t.received, d.loc from
(
select e.ename, eb.received , e.deptno
from emp e left outer join emp_bonus eb
on
e.empno=eb.empno
)
as t, dept as d where d.deptno = t.deptno
我只将JOIN ON
更改为t, dept where
为什么第一个版本失败了?