sum method

Expression<DT> sum(
  1. {Expression<bool>? filter}

Calculate the sum of all non-null values in the group.

If all values are null, evaluates to null as well. If an overflow occurs during calculation, sqlite will terminate the query with an "integer overflow" exception.

See also total, which behaves similarly but returns a floating point value and doesn't throw an overflow exception. To only consider rows matching a predicate, you can set the optional filter. Note that filter is only available from sqlite 3.30, released on 2019-10-04. Most devices will use an older sqlite version.


Expression<DT> sum({Expression<bool>? filter}) =>
    _AggregateExpression('SUM', [this], filter: filter);