bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server AVG() Function

Example

SELECT AVG(Price) AS
  AveragePrice FROM Products;

Definition and Usage

The AVG() function returns the average value of an expression.

Note

NULL values are ignored.

Syntax

AVG(
expression
)

Parameter Values

ParameterDescription
expressionRequired. A numeric value (can be a field or a formula)

Technical Details

Works in:SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

Previous

SQL Server ATN2() Function

Next

SQL Server CEILING() Function