SQL
General Aggregate Functions
<div class="nostroke_table"></div>  
|   |   |
|:--|:--------|
| **Description** |Calculates the sum of all non-null values in `arg`. |
| **Example** | `sum(A)` |
| **Alias(es)** | - |  
#### Handling `NULL` Values {#docs:sql:functions:aggregates::handling-null-values}  
All general aggregate functions except for [`list`](#::listarg) and [`first`](#::firstarg) (and their aliases [`array_agg`](#::array_aggarg) and [`arbitrary`](#::arbitraryarg), respectively) ignore `NULL`s.
To exclude `NULL`s from `list`, you can use a [`FILTER` clause](#docs:sql:query_syntax:filter).
To ignore `NULL`s from `first`, you can use the [`any_value` aggregate](#::any_valuearg).  
All general aggregate functions except [`count`](#::countarg) return `NULL` on empty groups and groups without non-`NULL` inputs.
In particular, [`list`](#::listarg) does *not* return an empty list, [`sum`](#::sumarg) does *not* return zero, and [`string_agg`](#::string_aggarg-sep) does *not* return an empty string in this case.