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

# `concat` 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 the concatenation of the arguments. This function is a synonym for [`||` (pipe pipe sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/pipepipesign.md).

## Syntax

```
concat(expr1, expr2 [, ...] )
```

## Arguments

* `exprN`: Expressions which are all STRING, all BINARY or all ARRAYs of STRING or BINARY.

## Returns

The result type matches the argument types.

There must be at least one argument.

When concatenating arrays, Databricks raises [COLLECTION\_SIZE\_LIMIT\_EXCEEDED](https://docs.databricks.com/aws/en/error-messages/collection-size-limit-exceeded-error-class.md) if the result exceeds the array size limit.

## Common error conditions

* [COLLECTION\_SIZE\_LIMIT\_EXCEEDED](https://docs.databricks.com/aws/en/error-messages/collection-size-limit-exceeded-error-class.md)

## Examples

```sql
> SELECT concat('Spark', 'SQL');
 SparkSQL
> SELECT concat(array(1, 2, 3), array(4, 5), array(6));
 [1,2,3,4,5,6]
```

## Related functions

* [`||` (pipe pipe sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/pipepipesign.md)
* [`array_join` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_join.md)
* [`array_union` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_union.md)
* [`concat_ws` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/concat_ws.md)
