REPLICATE( string_expression, number_expression )
Code:
SELECT REPLICATE('Staying alive',5) AS RESULT
Result:
RESULT |
-----------------------------------------------------------------+
Staying aliveStaying aliveStaying aliveStaying aliveStaying alive|
Code:
SELECT REPEAT('Staying alive',5) AS RESULT;
Result:
RESULT |
-----------------------------------------------------------------+
Staying aliveStaying aliveStaying aliveStaying aliveStaying alive|
Code:
CREATE OR REPLACE FUNCTION REPEAT_STR (str varchar, occurrences float)
RETURNS string
LANGUAGE JAVASCRIPT
AS
$$
return STR.repeat( OCCURRENCES );
$$;
SELECT REPEAT_STR('Staying alive ', 5) AS RESULT;
Result:
RESULT |
-----------------------------------------------------------------+
Staying aliveStaying aliveStaying aliveStaying aliveStaying alive|