Saturday, August 1, 2015

SQL Tutorial - lesson 18 - SUM function

If you wanted to calculate the sum of any numeric field in the table then you use sum function

syntax:

select sum(quantity) as total quantity from products;

When you run the above SQL query, SQL will add all the value under the quantity and display the sum value.

No comments:

Post a Comment