The following describes the Mysql Aggregate functions used in combination with group by. If you are interested in Mysql Aggregate functions, I believe they will help you.
Unless otherwise specified, Mysql Aggregate functions ignore null records.
Unless otherwise specified, Mysql Aggregate functions return null if no matching record set is null.
If you use the Mysql aggregate function in a statement that does not use group by, it is equivalent to grouping all rows.
Aggregate (GROUP BY
) Functions
Name |
Description |
AVG() |
Return the average value of the argument |
BIT_AND() |
Return bitwise and |
BIT_OR() |
Return bitwise or |
BIT_XOR() (V4.1.1) |
Return bitwise xor |
COUNT(DISTINCT) |
Return the count of a number of different values |
COUNT() |
Return a count of the number of rows returned |
GROUP_CONCAT() (V4.1) |
Return a concatenated string |
MAX() |
Return the maximum value |
MIN() |
Return the minimum value |
STDDEV_POP() (V5.0.3)STDDEV() STD() |
Return the population standard deviation |
STDDEV_SAMP() (V5.0.3) |
Return the sample standard deviation |
SUM() |
Return the sum |
VAR_POP() (V5.0.3)VARIANCE() (V4.1) |
Return the population standard variance |
VAR_SAMP() (V5.0.3) |
Return the sample variance |
Bit_and () If no rows are returned, it is the largest unsigned bigint INTEGER:18446744073709551615
Bit_or () and bit_xor () are 0 if no rows are returned.
Count *) returns the data of all rows, including null. If no row is returned, it is 0.
Countexpr) returns all non-null data. If no row is returned, it is 0.
Countdistinct expr) returns all non-null data. If no row is returned, it is 0. It is not compatible with SQL standards. standard SQL returns the number of rows of all different data, including null values.
MySQL string case-sensitive Conversion Function
Use of MySQL concat Functions
Implementation of MySql remote connection
MySQL primary key design principles
MySQL partition functions and restrictions