Skip to main content

space function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Returns a string consisting of n spaces.

Syntax

space(n)

Arguments

  • n: An INTEGER expression that evaluates to a numeric.

Returns

A STRING.

If n is less than or equal to 0 an empty string.

Examples

SQL
> SELECT concat('1', space(2), '1');
1 1