AVG in SQL SERVER

AVG is an aggregate function which is used to obtain the average of the values in a particular column.

Syntax:

SELECT AVG(<Column Name>) from <Table Name>

Example:

We have a table with the following data in the table SALES.

ITEMPRICE
ABC99.05
ABC1110.99
ABC270.89
ABC3100.99
ABC455.89


In order find out the average price of items in the sales we should use AVG function.

QUERY:

SELECT AVG(PRICE) FROM SALES

Result Set:
















Result set contains average of all the values in PRICE column.

This entry was posted in , . Bookmark the permalink.

Leave a reply