查询employees表中所有行,而不管是否有与departments中相匹配这个条件.
以下三个语句能够达到要求.
select count(*)
from employees e left join departments d
on (e.department_id=d.department_id)
select count(*)
from departments d,employees e
where d.department_id(+)=e.department_id
select count(*)
from departments d right join employees e
on (e.department_id=d.department_id)
阅读(1695) | 评论(0) | 转发(0) |