Repeat the string three times:
SELECT REPEAT(“SQL Tutorial”, 3); |
The REPEAT() function replicates a string as many times as specified.
REPEAT(string, number) |
Parameter |
Description |
string |
Input required: The string that will be repeated. |
number |
Input required: The number of times the string will be repeated. |
Works in: | From MySQL 4.0 |
Duplicate the text in the CustomerName column twice.
SELECT REPEAT(CustomerName, 2) FROM Customers; |
Duplicate the string zero times.
SELECT REPEAT(“SQL Tutorial”, 0); |