Aller au contenu

Renvoie une chaîne composée de la chaîne str répétée count fois. Si count est inférieur à 1, renvoie une chaîne vide. Renvoie NULL si str ou count est NULL.

func.repeat(<str>, <count>)
func.repeat(<str>, <count>)
┌─────────────────────────┐
│ func.repeat('plaid', 3) │
├─────────────────────────┤
│ plaidplaidplaid │
└─────────────────────────┘
REPEAT(<str>, <count>)
Arguments Description
<str> La chaîne.
<count> Le nombre.
SELECT REPEAT('databend', 3);
┌──────────────────────────┐
│ REPEAT('databend', 3) │
├──────────────────────────┤
│ databenddatabenddatabend │
└──────────────────────────┘
SELECT REPEAT('databend', 0);
┌───────────────────────┐
│ REPEAT('databend', 0) │
├───────────────────────┤
│ │
└───────────────────────┘
SELECT REPEAT('databend', NULL);
┌──────────────────────────┐
│ REPEAT('databend', NULL) │
├──────────────────────────┤
│ NULL │
└──────────────────────────┘