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,
	SUM (dumper_cycles.ulgl1 = 1) as ULGL1,
	SUM (dumper_cycles.ulgl2 = 1) as ULGL2,
	SUM (dumper_cycles.ulgl3 = 1) as ULGL3
 
FROM dumper_cycles
Where (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY hour(dumper_cycles.t_stamp)