📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

REPEAT



Returns a string consisting of the string str repeated count times. If count is less than 1, returns an empty string. Returns NULL if str or count are NULL.

Syntax

REPEAT(<str>, <count>)

Arguments

ArgumentsDescription
<str>The string.
<count>The number.

Examples

SELECT REPEAT('datalake', 3); +--------------------------+ | REPEAT('datalake', 3) | +--------------------------+ | datalakedatalakedatalake | +--------------------------+ SELECT REPEAT('datalake', 0); +-----------------------+ | REPEAT('datalake', 0) | +-----------------------+ | | +-----------------------+ SELECT REPEAT('datalake', NULL); +--------------------------+ | REPEAT('datalake', NULL) | +--------------------------+ | NULL | +--------------------------+

Was this page helpful?