July 19, 2017

Left Join

Every rows from left table and matching records from right

select
emp.id,
emp.name,
dept.name
from employee emp
left join department dept
on emp.dept_id = dept.dept_id

Even if the employee doesn't have a department, he/she will be listed here.

No comments:

Post a Comment