SELECT `projects`.`id`, `projects`.`title`, SUM(`CHECK_MAX`.`max_online`)
FROM `projects`
INNER JOIN `servers` ON (`servers`.`id_project` = `projects`.`id`)
INNER JOIN (
SELECT
`checks`.`id_server`,
`checks`.`date_check`,
MAX(`checks`.`online`) AS `max_online`
FROM `checks`
GROUP BY `checks`.`id_server`, `checks`.`date_check`
) AS `CHECK_MAX` ON (`CHECK_MAX`.`id_server` = `servers`.`id`)
GROUP BY `projects`.`id`, `CHECK_MAX`.`date_check`;