# CONCAT
## Definition(s)
### Context
#### Sub-context: [[SQL keywords]]
>[! Definition]
>A SQL function that adds strings together to create new text strings that can be used as unique keys
#### Sub-context: [[Function#Spreadsheet functions]]
>[! note] Definition
>A ==spreadsheet== function that concatenates string values together.
>Distinct from [[CONCATENATE|=CONCATENATE()]]
## Examples
### Basic SQL syntax
```SQL
SELECT
CONCAT(field1, " ", field2)
FROM
[table_name]
```
### Basic Spreadsheet syntax
```excel
=CONCAT(A1,B1)
```
The above code will merge text in A1 and B1 with no spaces. ==If a space is desired, use [[CONCATENATE|=CONCATENATE()]]== which can take an additional arguments.
## Related
### Related SQL
[[CONCAT_WS]]
[[double pipe operator]]
## Resources
## Flashcards
The below code are generated for use with [Spaced Repetition plugin](https://github.com/st3v3nmw/obsidian-spaced-repetition/) [docs](https://www.stephenmwangi.com/obsidian-spaced-repetition/)
A SQL function that adds strings together to create new text strings that can be used as unique keys @@@ [[CONCAT]]
A ==spreadsheet== function that concatenates string values together.
Distinct from [=CONCATENATE()](app://obsidian.md/CONCATENATE) @@@ [[CONCAT|=CONCAT()]]
<!--SR:!2000-01-01,1,250!2025-02-20,1,230-->