C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
| MySQL AVG() FunctionThe avg() is a Math function of MySQL. This function is used to get the average value from the given expression. Syntax
 select avg(aggregate_expression) from table_name [where condition]; Parameter
 aggregate_expression: It is the column name for getting average table_name: It is the table for getting records. where condition: It is optional. It is used to get conditional records. Returns
 This function returns the average value from the given expression. 
 Table:  Example 1select avg(marks) as "Total Marks" from table2; Output:   Example 2select avg(marks) as "Total Marks" from table2 where marks>65; Output:   Example 3select avg(DISTINCT marks) as "Total Marks" from table2 where marks>60; Output:   
Next TopicMySQL Math
 |