This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kurs:joins [2020/05/11 12:03] admin |
kurs:joins [2020/05/12 10:09] (current) admin |
||
---|---|---|---|
Line 70: | Line 70: | ||
left join hr.regions on countries.region_id = regions.region_id | left join hr.regions on countries.region_id = regions.region_id | ||
where region_name = 'Europe' | where region_name = 'Europe' | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | SELECT | ||
+ | first_name, | ||
+ | last_name, | ||
+ | e.department_id aktuelle_department_id, | ||
+ | jh.department_id jh_department_id, | ||
+ | e.job_id aktuelle_job_id, | ||
+ | jh.job_id jh_job_id, | ||
+ | start_date, | ||
+ | end_date | ||
+ | FROM | ||
+ | employees e left JOIN job_history jh | ||
+ | ON e.employee_id = jh.employee_id | ||
+ | ORDER BY | ||
+ | coalesce(e.employee_id, jh.employee_id) | ||
</code> | </code> |