SELECT
    okey.roundtime,
    okey.Total_count,
    okey.Total_count / okey.Total_count AS Total_perc,
    okey.Total_count * 3600
      / TIMESTAMPDIFF(SECOND, :starttime, :endtime) AS Total_rate
FROM (
    SELECT
        FROM_UNIXTIME(
          CEIL(UNIX_TIMESTAMP(alltable.t_stamp) / 60) * 60
        ) AS roundtime,
        COUNT(*) AS Total_count
    FROM alltable
	WHERE (alltable.t_stamp BETWEEN :starttime AND :endtime) and ('Induct 1' = :Induct)
    GROUP BY roundtime
) AS okey
ORDER BY okey.roundtime;
