EXTRACT(...)
All functions > ARRAY OF ROWS > EXTRACT(...)
Returns the extracted fields from the given expression.
Syntax
base[ field | * | -field, ... ]
Notes
- Extracts fields from a ROW or an array of rows. Bracket items run left to right.
xandx AS ycopy from the source row;*copies remaining source fields;-xremoves an output name already selected- A single unaliased field (
R[a]) is a scalar. A keep list,*,-name, orASproduces a ROW, including when one field remains - On an array of rows the same bracket applies to each element
NULLrows or missing fields yieldNULLwhere appropriate- Operator form:
base[field],base[*, -field];EXTRACT(...)is the call equivalent - Date
EXTRACT(UNIT FROM ts)is not this function — writeDATE_PART(ts, 'year')
Related Functions
See also
Examples
FeatureQL
RETURN
-- Project one field from an array of rows
f1 := (ARRAY(ROW(10 AS x, 20 AS y), ROW(30 AS x, 40 AS y)))[x]
;Result
| f1 ARRAY |
|---|
| [10, 30] |
On this page