Home /SQL/SQL AVG Function

SQL LCASE Functions

The AVG() function returns the average value of a numeric column.

SQL AVG() Syntax:

SELECT AVG(Column) FROM Table

Example

We have the following "Orders" table:

OrderIDCustomerDateOrderPrice
1Jones2012/01/011000
2Smith2012/01/021600
3Watson2012/01/02700
4Jones2012/01/03300
5Brown2012/01/032000
6Smith2012/01/041000

Now we want to find the average value of the "OrderPrice" fields.

We use the following SQL statement:

SELECT AVG(OrderPrice) AS OrderAverage FROM Orders

The result-set will look like this:

OrderAverage: 950