PNP_PIbd-31_Rodionov_I_A_Co.../data/requestDevices.sql

15 lines
396 B
MySQL
Raw Permalink Normal View History

2024-12-24 18:02:23 +04:00
SELECT
d.*,
l.name AS location_name,
2025-01-14 21:28:06 +04:00
TRIM(CONCAT(e.last_name, ' ', e.first_name, ' ', e.patronymic)) AS employee_full_name,
2024-12-24 18:02:23 +04:00
e.fk_id_department AS department_id,
2025-01-14 21:28:06 +04:00
dep.name AS department_name
2024-12-24 18:02:23 +04:00
FROM
device d
JOIN
location l ON d.fk_id_location = l.id
2025-01-14 21:28:06 +04:00
LEFT JOIN
2024-12-24 18:02:23 +04:00
employee e ON d.fk_id_employee = e.id
2025-01-14 21:28:06 +04:00
LEFT JOIN
2024-12-24 18:02:23 +04:00
department dep ON e.fk_id_department = dep.id;