Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

Avg

Example

Retrieve the average price from the “Price” column in the “Products” table.

SELECT Avg(Price) AS AveragePrice FROM Products;

Definition and Usage

The Avg() function calculates the average value of an expression, excluding NULL values.

Syntax

Avg(expression)

Parameter Values

Parameter

Description

expression

Required: A numerical value, which can be either a field or a formula.

Technical Details

Works in:

 From Access 2000

More Examples

Example

Select products where the price exceeds the average price.

SELECT * FROM Products
WHERE Price > (SELECT Avg(Price) FROM Products);