以下查询无法解析:
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
第一个版本会失败?