【发布时间】:2020-09-02 06:25:08
【问题描述】:
我在下面有一个查询,它根据自我加入为我提供了该员工的员工和经理,
select e.name as employeename, m.name as managername
from employee e
left join employee m
on e.mgr_id = m.emp_id
where e.doj < m.doj
我知道当左加入第一个要加入的表时,必须在 where 子句中过滤,第二个在 on,我会在这里做什么,因为过滤器包含两个表,或者在另一个例子中,它不是自连接的,它是连接的在 2 个不同的表上,但过滤器包含两个表?谢谢
【问题讨论】: