ID EN
Aggregate Functions

AVG([DISTINCT] expr) [over_clause]

MySQL 8.4 🇮🇩 Bahasa Indonesia

AVG([BERBEDA] expr) [over_clause]

Syntax

MYSQL
SELECT student_name, AVG(test_score)
       FROM student
       GROUP BY student_name;

Contoh

Example

Returns the average value of expr. The DISTINCT option can be used to return the average of the distinct values of expr.

MYSQL
SELECT student_name, AVG(test_score)
       FROM student
       GROUP BY student_name;