LOOP(循环)

You are viewing an old version of this article. View the current version here.

语法结构

[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

Comments

Comments loading...
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.