BigQuery: Aggregation queries
Aggregate fields
You can fetch aggregations on columns along with nodes using an aggregation query.
The name of the aggregate field is of the form <field-name> + _aggregate
.
Common aggregation functions are count
, sum
, avg
, max
, min
, etc. You can see the complete specification of the
aggregate field in the API reference.
Fetch aggregated data of an object
Example: Fetch a list of articles with aggregated data of their rating:
GraphiQL
Query Variables
Request Headers
Note
The query field will be of the format <dataset_name>_<table_name>
.
Fetch aggregated data on nested objects
The following is an example of a nested object query with aggregations on the array relationship between an author and articles.
Example: Fetch author with id "1" and a nested list of articles with aggregated data of their rating:
GraphiQL
Query Variables
Request Headers