bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL REPEAT() Function

Concept visual

MySQL REPEAT() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Repeat a string 3 times:

SELECT REPEAT("SQL Tutorial", 3);

Definition and Usage

The REPEAT() function repeats a string as many times as specified.

Syntax

Repeat(

string, number )

Parameter Values

Parameter

Description string

Required. The string to repeat number Required. The number of times to repeat the string

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Repeat the text in CustomerName 2 times: SELECT REPEAT(CustomerName, 2)

FROM Customers;

Example

Repeat the string 0 times:

SELECT REPEAT("SQL Tutorial", 0);

Previous

❮ MySQL Functions

Next

Previous

MySQL POSITION() Function

Next

MySQL REPLACE() Function