Geek University

SQL SUM() Function

The SQL SUM() function is used to return the total of all values in the specific table column. The syntax is:

SELECT SUM(column_name) FROM table_name;

Let’s say that we want to determine the total value of sold albums from the Album table. We can use the following SQL SUM() statement:

SELECT SUM(sell) FROM album;

This SQL statement  would produce the following result:

+--------+
| sell   |
+--------+
|     23 |
+--------+

Subscribe to our Newsletter

Like us on Facebook

Share on Twitter

top
Developed by Signum Soft