VeloDB Cloud
SQL Manual
Functions
string-functions
repeat

repeat

Description

Syntax:

VARCHAR repeat (VARCHAR str, INT count)

This function repeats the str for count times. If count is less than 1, it will return an empty string. If str or count is NULL, it will return NULL.

Example

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

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

Keywords

REPEAT