Tech Junkie Blog: SQL: SUM() Aggregate Function

Sunday, March 8, 2015

SQL: SUM() Aggregate Function

The SUM() function is used to sum up all the values in the specified column.

SELECT SUM(UnitsInStock) AS TotalInventory
FROM Products

The above query gets the total number of units in stock for all products

No comments:

Post a Comment