-
Notifications
You must be signed in to change notification settings - Fork 409
Arrays and Maps
Rene Saarsoo edited this page Nov 10, 2023
·
3 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:
- BigQuery.
- DB2.
- DB2i.
- PostgreSQL.
- Trino
Map literals in JSON style {"foo": 1, "bar": "John"}
. Supported by:
- N1QL.
Array and Map access using square brackets like arr[1]
and map['key']
.
Supported by:
Array subscript operator arr[OFFSET(5)]
. Supported by:
Notes:
- 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.