メインコンテンツまでスキップ
バージョン: Latest-3.4

repeat

この関数は、strcount の回数だけ繰り返します。count が 1 未満の場合、空の文字列を返します。str または count が NULL の場合、NULL を返します。

Syntax

VARCHAR repeat(VARCHAR str, INT count)

Examples

MySQL > SELECT repeat("a", 3);
+----------------+
| repeat('a', 3) |
+----------------+
| aaa |
+----------------+

MySQL > SELECT repeat("a", -1);
+-----------------+
| repeat('a', -1) |
+-----------------+
| |
+-----------------+

keyword

REPEAT,