There is no TOP keyword in MySQL in MySQL, as far as I know. You need Limit :
SELECT * FROM ( SELECT paused_time as end_time FROM production_time WHERE created_time = curdate() UNION SELECT resumed_time as end_time FROM pause_timer WHERE created_time = curdate() UNION SELECT end_time as end_time FROM timer_idle WHERE created_time = curdate() ) as end_time ORDER BY end_time DESC LIMIT 1
source share