设定从某个时间执行脚本,直到现在

CREATE DEFINER=`game`@`%` PROCEDURE `sp_call_spec_days`(in procedure_code int,IN begin_date date)
BEGIN

select begin_date into @handle_date;

REPEAT
select @handle_date;

IF (procedure_code = 1) THEN
call sp_player_platform_anyday_snapshot(@handle_date);
select procedure_code;
END IF;

set @handle_date = @handle_date + INTERVAL 1 DAY;
UNTIL @handle_date = CURDATE() END REPEAT;
END

原文地址:https://www.cnblogs.com/tangbinghaochi/p/6374205.html