---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/avg.md
cuppy_section: docs
cuppy_doc: Z0G8-9YJN
cuppy_doc_uuid: 90ebdf34-0b86-4c04-be11-c38b859344bf
cuppy_permalink: https://cuppy.io/salesforce/d/Z0G8-9YJN
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/avg
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 5f17e810d4db498d58aa3f5459f40646b06f2fef069df5cdcce6414161fc9fcc
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/avg.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## `AVG`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the average (arithmetic mean) of all input values.

*   `<expression>`: An expression of any numerical type.

*   `numeric` with a scale of 6 for integer-type arguments and numeric arguments with a scale less than 6.
*   `double precision` for floating-point arguments.
*   Otherwise, returns the same as argument the type.

Returns NULL if no rows are selected.

*   NULL values are ignored in the calculation.
*   Returns NULL when applied to an empty set.
*   Use `COALESCE` to substitute a default value for NULL results.

Get the average price of products.

Calculate the average salary by department.

Use COALESCE to handle NULL results.

*   [SUM](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/sum.html)
*   [COUNT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/count.html)
*   [Aggregate Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/aggregate.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
