This MariaDB tutorial explains how to use the MariaDB REPEAT function with syntax and examples.
The MariaDB REPEAT function repeats a string a specified number of times.
The syntax for the REPEAT function in MariaDB is:
REPEAT( string, number )
The string to repeat.
The number of times to repeat the string.
The REPEAT function can be used in the following versions of MariaDB:
Let's look at some MariaDB REPEAT function examples and explore how to use the REPEAT function in MariaDB.
For example:
SELECT REPEAT('T', 2);
Output: 'TT'
SELECT REPEAT('t', 5);
Output: 'ttttt'
SELECT REPEAT('dbd', 2);
Output: 'dbddbd'
SELECT REPEAT(' ', 6);
Output: ' '
SELECT REPEAT(123, 2);
Output: '123123'
SELECT REPEAT('abc', 0);
Output: ''