Last updated 1 year ago
Returns a number of occurrences of blank spaces ().
SPACE ( integer_expression )
SPACE(<n>)
Custom function used to emulate the behavior
function SPACE( occurrences ){ return ' '.repeat( occurrences ); }
Input:
SELECT CONCAT('SOME', SPACE(5), 'TEXT') AS RESULT;
Output:
RESULT | -------------+ SOME TEXT|
CREATE OR REPLACE FUNCTION SPACE(occurrences float) RETURNS string LANGUAGE JAVASCRIPT AS $$ function SPACE( occurrences ){ return ' '.repeat( occurrences ); } return SPACE( OCCURRENCES ); $$; SELECT CONCAT('SOME', SPACE(5), 'TEXT') RESULT;