Skip to content

REPEAT

Return a character string that is repeated n times.

REPEAT(string, number)

The second argument must be a literal number value. You cannot specify a column name. A negative number is interpreted as zero.

For example, return the season_name repeated three times:

premdb=# SELECT REPEAT(season_name,3) FROM season ORDER BY 1;
          repeat            
-----------------------------
 1992-19931992-19931992-1993
 1993-19941993-19941993-1994
 1994-19951994-19951994-1995
...

Parent topic:String Functions