Loading lesson path
Concept visual
Start at both ends
Return the sum of the "Quantity" field in the "OrderDetails" table:
SELECT SUM(Quantity) AS TotalItemsOrdered FROM OrderDetails;The SUM() function calculates the sum of a set of values.
NULL values are ignored.
expression )
Required. A field or a formula
From MySQL 4.0
❮ MySQL Functions