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
SELECT r1.category_order, SUM(r1.number_group) as sum_r1,r2.sum_r2, r3.sum_r3, r4.sum_r4, r5.sum_r5 FROM orders r1
LEFT JOIN (SELECT category_order,SUM(number_group) as sum_r2 FROM orders WHERE region = 2 GROUP BY category_order) r2 on r2.category_order = r1.category_order
LEFT JOIN (SELECT category_order,SUM(number_group) as sum_r3 FROM orders WHERE region = 3 GROUP BY category_order) r3 on r3.category_order = r1.category_order
LEFT JOIN (SELECT category_order,SUM(number_group) as sum_r4 FROM orders WHERE region = 4 GROUP BY category_order) r4 on r4.category_order = r1.category_order
LEFT JOIN (SELECT category_order,SUM(number_group) as sum_r5 FROM orders WHERE region = 5 GROUP BY category_order) r5 on r5.category_order = r1.category_order
WHERE r1.region = 1 GROUP BY r1.category_order