Skip to content

REPEAT

  • string: This parameter refers to the string that will be repeated. It can be any string of characters the user wishes to repeat.
  • count: This parameter indicates the number of times the specified string should be repeated. If count is less than 1, the function returns an empty string.
SELECT REPEAT('SQL ', 3) AS RepeatedString;
RepeatedString
---------------
SQL SQL SQL

In the given SQL statement, the MySQL REPEAT() function is used. This function repeats a given string for a specified number of times. Here, ‘SQL ’ is repeated 3 times, producing the output ‘SQL SQL SQL ’.