# **REPEAT()**

## **Function Description**

`REPEAT()` is used to repeat the input string `str` in count` times and return a new string. If `count` is less than 1, an empty string is returned. If `str` or `count` is `NULL`,`NULL` is returned.

## **Function Syntax**

```text
> REPEAT(str,count)
```

## **Parameter definition**

| Parameters | Description |
| ---- | ---- |
| str | Required parameters. The string to be repeated. |
| count | Required parameters. Number of times to be repeated|

## **Example**

```text
mysql> SELECT repeat('abc', -1);
+-----------------------+
| repeat(abc, -1) |
+-----------------------+
| |
+-----------------------+
1 row in set (0.00 sec)

mysql> SELECT repeat('abc', 1), repeat('abc', 2), repeat('abc', 3);
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| repeat(abc, 1) | repeat(abc, 2) | repeat(abc, 3) |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| abc | abcabc | abcabcabc |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.00 sec)
```
