Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 329 Bytes

filtering-arrays.md

File metadata and controls

14 lines (11 loc) · 329 Bytes

Filtering arrays

Explore this snippet here.

Description

The ARRAY function in BigQuery will accept an entire subquery, which can be used to filter an array:

select array(
  select x
  from unnest((select [1, 2, 3, 4])) as x
  where x <= 3 -- Filter predicate
) as filtered