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.
numericwith a scale of 6 for integer-type arguments and numeric arguments with a scale less than 6.double precisionfor 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
COALESCEto 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.