This function is used to return the string after str is repeated for n times.
repeat(string <str>, bigint <n>)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
str |
Yes |
STRING |
If the value is of the BIGINT, DOUBLE, DECIMAL, or DATETIME type, the value is implicitly converted to the STRING type for calculation. |
n |
Yes |
BIGINT |
Number used for repetition |
The return value is of the STRING type.
The value 123123 is returned after the string 123 is repeated twice.
SELECT repeat('123', 2);