---
title: space function
description: Learn the syntax of the space function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/space
---

# `space` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) 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
```

## Related functions

* [`repeat` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/repeat.md)
