Provide the total sum of the “Quantity” values from the “OrderDetails” table.
SELECT SUM(Quantity) AS TotalItemsOrdered FROM OrderDetails; |
The SUM() function determines the total of a given set of values.
Note that any NULL values are disregarded.
SUM(expression) |
Parameter |
Description |
expression |
Mandatory: A field or an equation |
Works in: |
From MySQL version 4.0 |