SELECT
    CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp,
    CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(dumper_cycles.t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS Hour,

    CONCAT(ROUND(SUM(dumper_cycles.ulgl1 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL1,
    CONCAT(ROUND(SUM(dumper_cycles.ulgl2 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL2,
    CONCAT(ROUND(SUM(dumper_cycles.ulgl3 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL3,
    CONCAT(ROUND(SUM(dumper_cycles.ulgl4 = 1)/COUNT(*) * 100*2, 2),'%') AS ULGL4  -- <-- ADD THIS LINE

FROM dumper_cycles
WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY HOUR(dumper_cycles.t_stamp);