Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 520 Bytes

File metadata and controls

33 lines (24 loc) · 520 Bytes

repeat

description

Syntax

VARCHAR repeat(VARCHAR str, INT count)

将字符串 str 重复 count 次输出,count 小于1时返回空串,str,count 任一为NULL时,返回 NULL

example

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

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

keyword

REPEAT,