> This page is for Docs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Aggregate Functions

> Learn about the aggregate functions supported by Export ZOQL, including avg(), count(), max(), min(), and sum(), along with their limitations and examples.

Learn about the aggregate functions supported by Export ZOQL, including avg(), count(), max(), min(), and sum(), along with their limitations and examples.

## Overview

As of release 34.0, Export ZOQL supports several aggregate functions, detailed below.

Export ZOQL is used for creating exports from Zuora data sources, and uses a different syntax than standard ZOQL.

## avg()

Use `avg()` to return the average value.

Limitations

The `avg()` function supports only numeric values.

Example

```
select A.a,avg(A.c) from A group by A.a, B.b
```

## count()

Use `count()` to return the number of rows. Similar to standard SQL, you can use the following syntax with `count()` :

* `count(*)`
* `count(field)`

​The `count()` command is the only Export ZOQL command that supports the use of an asterisk ( `*` ).

Example

```
select count(*) from A
```

## max()

Use `max()` to return the largest value.

```
select count(a),max(c),b from A group by b
```

## min()

Use `min()` to return the smallest value.

```
select count(a),min(c),b from A group by b
```

## sum()

Use `sum()` to return the sum.

Limitations

The `sum()` function supports only numeric values.

Example

```
select A.a, sum(A.b) from A
```

## Limitations of the Aggregate Functions

The aggregate functions have the same limitations as standard SQL aggregate functions.

In addition to specific limitations, you cannot nest aggregate functions.