forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
5.8 KiB
5.8 KiB
repeat
This function is used to return the string after str is repeated for n times.
Syntax
repeat(string <str>, bigint <n>)
Parameters
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 |
Return Values
The return value is of the STRING type.
Example Code
The value 123123 is returned after the string 123 is repeated twice.
SELECT repeat('123', 2);
Parent topic: String Functions