In MySQL, DATABASE()
is a built-in function that returns the default (current) database name.
The result is returned as a string in the utf8
character set. If there is no default database, it returns NULL
.
In MySQL, DATABASE()
is a built-in function that returns the default (current) database name.
The result is returned as a string in the utf8
character set. If there is no default database, it returns NULL
.
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 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 readingSQL Server has a HAS_DBACCESS()
function that returns information about whether the user has access to a specified database.
In 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.
Below are two options for returning a list of functions in MariaDB.
Continue readingSome 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.