repeat
On this page
Repeats a string a specified number of times.
Syntax
repeat(<string>, n => <n>)Arguments
| Argument | Type | Description |
|---|---|---|
<string> | string | String to repeat. |
n | int | Constant. Non-negative repetition count. Must not be NULL. |
Returns
Returns string. A count of 0 returns an empty string. Returns NULL if the input is NULL.
Examples
Repeat a dash to separate fields in a text label:
SELECT 'Checkout failures ' || repeat('-', n => 12) AS heading+--------------------------------+
| heading |
+--------------------------------+
| Checkout failures ------------ |
+--------------------------------+