10. Employee Summary от Joins and Subqueries
Един от тестовете в judge не минава, но не мога да разбера защо. Просто дава грешен отговор без никакво описание, а заявката си изглежда правилна.
SELECT e.employee_id,
concat(e.first_name,' ',e.last_name)
AS `employee_name`,
concat(em.first_name,' ',em.last_name)
AS `manager_name`,d.name as `department_name`
FROM employees AS e
LEFT JOIN employees AS em
ON e.manager_id=em.employee_id
LEFT JOIN departments AS d
ON e.department_id=d.department_id
ORDER BY e.employee_id
LIMIT 5;