In MySQL, the SUM()
aggregate function returns the sum of a given expression.
It can also be used to return the sum of all distinct (unique) values in an expression.
Continue readingIn MySQL, the SUM()
aggregate function returns the sum of a given expression.
It can also be used to return the sum of all distinct (unique) values in an expression.
Continue readingIn MariaDB, the COUNT()
aggregate function returns a count of the number of non-NULL values of an expression in the rows retrieved by a SELECT
statement.
In MariaDB, the AVG()
function returns the average value of the given expression.
The DISTINCT
option can be used to return the average of the distinct values (i.e. remove duplicates before calculating the average).
NULL
values are ignored.
In MariaDB, the SUM()
aggregate function returns the sum of a given expression.
It can also be used to return the sum of all distinct (unique) values in an expression.
Continue readingIn MariaDB, MIN()
is an aggregate function that returns the minimum value in a given expression.
In MariaDB, MAX()
is an aggregate function that returns the maximum value in a given expression.
Some RDBMSs like MySQL and MariaDB have a GROUP_CONCAT()
function that allows you to return a query column as a delimited list (for example, a comma separated list).
PostgreSQL has a similar function called STRING_AGG()
. This function works in pretty much the same way that GROUP_CONCAT()
works in MySQL and MariaDB.
Some RDBMSs have a GROUP_CONCAT()
function that allows you to return a query column as a delimited list (for example, a comma separated list). MySQL and MariaDB are two that have such a function.
PostgreSQL and SQL Server have similar functions called STRING_AGG()
.
Oracle, on the other hand, has the LISTAGG()
function that does pretty much the same thing (and perhaps more).
So you could say that LISTAGG()
is Oracle’s GROUP_CONCAT()
equivalent.
MySQL has a GROUP_CONCAT()
function that enables us to return columns from a query as a delimited list.
It returns a string result with the concatenated non-NULL
values from a group.
In Oracle, the LISTAGG()
function enables us to combine data from multiple rows in to a single row.
We have the option of specifying a separator (such as a comma). We can also order the results produced by the LISTAGG()
function, and more.