Skip to main content
Returns a string formed by repeating the input string a specified number of times.

Syntax

Parameters

ParameterDescriptionSupported input types
<string>The string to repeat.TEXT
<n>The number of times to repeat the string.INTEGER, BIGINT

Return Type

TEXT

Remarks

  • If <n> is 0 or negative, an empty string is returned.
  • If either argument is NULL, NULL is returned.
  • REPEAT supports multi-byte UTF-8 characters.

Example

The following example repeats the string 'Firebolt' three times:
result text
FireboltFireboltFirebolt

Rows: 1Execution time: 3.04ms

The following example shows that a non-positive count returns an empty string:
result text

Rows: 1Execution time: 2.40ms