Can I run a loop in MySQL without using a procedure/function?

后端 未结 4 936
Happy的楠姐
Happy的楠姐 2021-02-18 13:39

For testing, is it possible to run a loop from MySQL workbench or similar tool? I tried but got an error.

If it is possible, please supply a simple example I can run.

4条回答
  •  长情又很酷
    2021-02-18 14:31

    If it is that you only want to block the current thread then use select sleep(seconds); otherwise you can use a stored procedure (if there's something you want to loop over) or a UDF (user defined function).

提交回复
热议问题