提问者:小点点

waitfor命令对SQL中的延迟不起作用


我在MySQL中使用“waitfor”命令时总是会出错,我还检查了MySQL文档,但没有写在文档中!

此命令是否有任何更新?

请帮帮我


共1个答案

匿名用户

您可以尝试sleep命令。

与:

select current_time();
do sleep(5);
select current_time();

我得到:

--------------
select current_time()
--------------

current_time()
13:23:42
--------------
do sleep(5)
--------------

--------------
select current_time()
--------------

current_time()
13:23:47

参见https://dev.mysql.com/doc/refman/8.0/en/do.html