SQL
Retrieving Values from Arrays
Retrieving one or more values from an array can be accomplished using brackets and slicing notation, or through [list functions](#docs:sql:functions:list::list-functions) like `list_extract` and `array_extract`. Using the example in [Defining an Array Field](#::defining-an-array-field).  
The following queries for extracting the second element of an array are equivalent:  
```sql
SELECT id, arr[1] AS element FROM array_table;
SELECT id, list_extract(arr, 1) AS element FROM array_table;
SELECT id, array_extract(arr, 1) AS element FROM array_table;
```  
| id | element |
|---:|--------:|
| 10 | 1       |
| 20 | 4       |  
Using the slicing notation returns a `LIST`:  
```sql
SELECT id, arr[1:2] AS elements FROM array_table;
```  
| id | elements |
|---:|----------|
| 10 | [1, 2]   |
| 20 | [4, 5]   |