|
|
MySQL Aggregate Functions With Example - Mysql
|
Views : 243
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
MySQL Aggregate Functions With Example
AVG()
Returns the average of the parameter passed. Returns 0 if no matching rows found.
Example:
Avg(salary)
COUNT()
Counts the number of NON NULL values of the parameter passed. Returns 0 if no matching rows found.
Example:
Select employee_id, COUNT(*) from table_name;
MAX()
Returns the maximum value of the parameter passed. Returns 0 if no matching rows found.
Example:
Select MAX(employee_salary) from table_name
MIN()
Returns the minimun value of the parameter passed. Returns 0 if no matching rows found.
Example:
Select MIN(employee_salary) from table_name
SUM()
Returns the sum of the parameter passed. Returns NULL if no matching rows found.
Example:
Select SUM(employee_salary) from table_name |
|
By Geethalakshmi, On - 2010-09-29 |
|
|
|