EXTRACT(...)
All functions > ARRAY OF ROWS > EXTRACT(...)
Returns the extracted fields from the given expression.
Syntax
base[ field, ... ]
Notes
- Extracts one or more fields from a ROW or an array of rows
- From a single ROW: one field returns a scalar; several return a small ROW
- From an array of rows, the same applies to each element: one field yields a column of scalars; several fields yield a column of small ROWs
- Reorder or rename in the list with
ASwhere needed; theEXTRACT(...)call form is equivalent when a parenthesized call is required NULLrows or missing fields yieldNULLwhere appropriate- Operator / accessor form:
base[field],base[f1, f2]; you can also writeEXTRACT(base, …, fields, …)in expression position
Related Functions
See also
Examples
FeatureQL
SELECT
f1 := (ARRAY[ROW(10 AS x, 20 AS y), ROW(30 AS x, 40 AS y)])[x] -- Project one field from an array of rows
;Result
| f1 ARRAY |
|---|
| [10, 30] |
On this page