Q&A
Ask and answer questions to make information more available to wider audiences.
Hayden Loafman @haydenloafman   19, Jul 2023 12:00 AM
SUM() function
What is the use of MariaDB SUM() function?
answers 1
 
Answer 1
Ethan Barbrow @ethanbarbrow   09, Aug 2023 03:22 PM
MariaDB SUM function is used to return the summed value of an expression.

If the table has no any rows, then SUM () returns NULL. The DISTINCT keyword is also used with SUM () to sum only the distinct values of an expression.

Syntax:

SELECT SUM(aggregate_expression)      
FROM tables      
[WHERE conditions];