SUM Aggregate Statement



Syntax:

SELECT SUM(Column)
FROM TableName;


What does it do?

The SUM aggregate will return a sum total of a column from all the rows in a table or from all the rows that meet a WHERE clause criteria.


Example:

SELECT SUM(Total) AS AllOrdersTotal
FROM Orders;


Results:

AllOrdersTotal
$35.00
HTML 5 Badge