What Is SUM() Function In SQL?
- SQL
SUM()
function is used for calculation of numeric/number type values in table columns in database. - SQL
SUM()
function returns the total sum of a numeric type column.
Syntax:
SELECT SUM(column_name) FROM table_name;
Example:
SELECT SUM(price) AS "Total Product's Price" FROM products;
- In above example a
SUM(price)
function returns the total price in price columnĀ in table (products).