Description\n-----------\n\nSyntax\n\n``sql\n[begin_label:] REPEAT\n    statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n`\n\nThe statement list within a REPEAT statement is repeated until the search_condition is true. Thus, a REPEAT always enters the loop at least once. statement_list consists of one or more statements, each\\\nterminated by a semicolon (i.e., ;) statement delimiter.\n\nA REPEAT statement can be labeled. end_label cannot be given unless begin_label is also present. If both are present, they must be the same.\n\nSee Delimiters in the mariadb client for more on client delimiter usage.\n\n`sql\nDELIMITER //\n\nCREATE PROCEDURE dorepeat(p1 INT)\n  BEGIN\n    SET @x = 0;\n    REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;\n  END\n//\n\nCALL dorepeat(1000)//\n\nSELECT @x//\n+------+\n| @x   |\n+------+\n| 1001 |\n+------+\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/programmatic-compound-statements/repeat-loop