Skip to main content Skip to complementary content

count

Returns the number of elements in the current array.

Arguments

Any expression can be used as argument, it will not be taken into account but it is required. Missing and null values are not counted.

Examples

In the query below, the count function returns the number of elements in o.items, regardless of the argument specified.
FROM order AS o UNNEST o.items AS i
SELECT {
  count = count(o)
}

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!