Product Solutions Support
Try MemSQL

SUM

Aggregate function. Calculate the sum of a set of numbers. NULL values are ignored. If no values can be summed, this function returns NULL.

SUM ( [DISTINCT] expression )

Arguments

Return Type

A double if the input type is double, otherwise decimal.

Examples

memsql> create table sumptuous (id int primary key, number1 int, number2 int);

memsql> insert into sumptuous values (1, 1024, 4096), (2, 23452, NULL);

memsql> select sum(number1), sum(number2) from sumptuous;
+--------------+--------------+
| sum(number1) | sum(number2) |
+--------------+--------------+
|        24476 |         4096 |
+--------------+--------------+
Was this article useful?