The MySQL sum() function returns the average of a numeric field. It is used when you need to find or calculate average of numeric fields value.
To find or calculate average of numeric field in a table, use the following syntax:
Parameters:
tablename: The table name from which you want to fetch records.
col1: The column or field name that will used to calculate average.
condition: To specifies the conditions that must be fulfilled. It is optional.
Note:
In the above example, we are calculating average of "workingHours" numeric field value in tblCustomerLoan" table.
You can use MySQL Command Line Client to find or calculate average of numeric fields value in the specified table. It will look like this: