DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`itemImageQueue_check` ON SCHEDULE EVERY 1 HOUR STARTS '2023-07-28 00:00:00.000' ON COMPLETION PRESERVE ENABLE DO BEGIN DELETE FROM itemImageQueue WHERE attempts >= (SELECT downloadMaxAttempts FROM itemConfig); END$$ DELIMITER ;