SELECT w.name_worker, w.surname_worker, w.midname_worker, w.id_worker, SUM(number) numb FROM workers w LEFT JOIN exhours e ON (w.id_worker = e.id_worker) LEFT JOIN orders o ON (e.id_order = o.id_order) WHERE o.datetime_order >= '$date_start' AND o.datetime_order <= '$date_end' GROUP BY w.id_worker I use this query to calculate the number of hours worked by an employee for a period of time. How can you add to the issue of all employees from the workers table, so that there are those who have not worked for this period? They advised me to use left join , but I haven’t changed anything