1
select sql_no_cache `labtech`.`h_commands`.`ComputerID` AS `computerid`,timestampdiff(DAY,`labtech`.`h_commands`.`DateExecuted`,now()) AS `timestampdiff(DAY,dateexecuted,Now())`,hour(`labtech`.`h_commands`.`DateExecuted`) AS `hour(dateexecuted)`,(minute(`labtech`.`h_commands`.`DateExecuted`) DIV 5) AS `(MINUTE(dateexecuted) DIV 5)` from `labtech`.`h_commands` order by `labtech`.`h_commands`.`ComputerID`,timestampdiff(DAY,`labtech`.`h_commands`.`DateExecuted`,now()),hour(`labtech`.`h_commands`.`DateExecuted`),(minute(`labtech`.`h_commands`.`DateExecuted`) DIV 5)