Return the sum of the "Quantity" field in the "OrderDetails" table:
SELECT SUM(Quantity) AS TotalItemsOrdered FROM OrderDetails;
Try it Yourself »
The SUM() function calculates the sum of a set of values.
Note: NULL values are ignored.
SUM(
expression)
Parameter | Description |
---|---|
expression | Required. A field or a formula |
Works in: | From MySQL 4.0 |
---|
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!