SELECT IFNULL(max(total_count*12),0) as max_pph FROM (
SELECT 
	Round(SUM(alltable.ACTUAL_DEST <> 'S0199' and alltable.ACTUAL_DEST <> 'S0168')) AS total_count
FROM alltable
Where (alltable.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY UNIX_TIMESTAMP(alltable.t_stamp) DIV 300) basa