-
Notifications
You must be signed in to change notification settings - Fork 435
Arrays and Maps
Rene Saarsoo edited this page Sep 5, 2025
·
6 revisions
Some SQL dialects have special syntax for creating and manipulating Array and Map types.
Array literals [1, "two", 3]. Supported by:
Array literals ARRAY[1, 2, 3]. Supported by:
Map literals in JSON style {"foo": 1, "bar": "John"}. Supported by:
Array and Map access using square brackets like arr[1] and map['key'].
Supported by:
Array subscript operator arr[OFFSET(5)]. Supported by:
Array slice operator arr[a:b]. Supported by:
Notes:
- DuckDB also supports a dot syntax to access values of structs.
- Snowflake also supports a dot syntax to access the values of keys. The first key has to be extracted with
:after that,.can be used to access deeper nested values.