Returns the average of the specified column values.
public average ( string $q, |
||
$q | string | the column name or expression. Make sure you properly [quote](guide:db-dao#quoting-table-and-column-names) column names in the expression. |
$db | the database connection used to generate the SQL statement. If this parameter is not given, the `db` application component will be used. | |
Результат | mixed | the average of the specified column values. |