MySql group the difference of 2 timestamp columns in minutes
SELECT  LEFT(startTime, 13) AS 'start of Hour',
        COUNT(*)  AS 'Total Jobs',
        SUM(TO_SECONDS(endTime) - TO_SECONDS(startTime) &lt;= 300) AS '0to5m',
        SUM(TO_SECONDS(endTime) - TO_SECONDS(startTime) BETWEEN 301 AND 600) AS '5to10m',
        ...
    FROM tbl
    GROUP BY LEFT(startTime, 13)


Optionally have WHERE jobID = 12.

Problems:


Does the startTime determine which hour bucket it is in?
If you want a row of zeros for missing hours, then you need a table with all hours and a LEFT JOIN from it.