Description
The AVG( ) function returns the average value of an expression. It returns NULL if there is no matching rows.
This function has the form:
SELECT AVG(expr)
Parameter | Description |
---|---|
expr | An expression |
Return Value
The average value of an expression. It returns NULL if there is no matching rows.
Examples
The following example shows the basic use of this function:
mysql> SELECT student_name, AVG(test_score)
-> FROM student
-> GROUP BY student_name;