This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-21. For the latest, interactive version please visit https://mariadb.com/kb/.

LOOP(循环)

语法结构

[begin_label:] LOOP
    statement_list
END LOOP [end_label]

描述说明

LOOP 实现了循环控制,使能够重复执行statement list部分。statement list部分 有一条或者是多条语句,每个语句都以(;) 结束。loop循环会一直持续,直到遇到LEAVE 退出。

LOOP 不能以labeled. end_label结束,除非loop以begin_label 开始。如果开始,结束部分都不曾省略,那loop名一定要相同。

有关(;)的用法更多可参考 Delimiters in the mysql client

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.