Skip to main content

SPACE

Description​

Generate a string consisting of a specified number of spaces.

Syntax​

SPACE ( <len> )

Parameters​

ParameterDescription
<len>The number of spaces to generate

Return Value​

Returns a string consisting of the specified number of spaces. Special cases:

  • If any Parameter is NULL, NULL will be returned.
  • When <len> is less than 0, an empty string is returned.

Examples​

SELECT space(10);
+------------+
| space(10) |
+------------+
| |
+------------+
SELECT space(null);
+-------------+
| space(NULL) |
+-------------+
| NULL |
+-------------+