Skip to main content

total

Function total 

Source
pub fn total<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Double, NonNull, Agg, ScopeOnly<E::Sources>>
Expand description

Floating-point sum that is never NULL (TOTAL), on SQLite.

The argument must be numeric. Unlike sum, TOTAL of no rows is 0.0, so the result is non-null. It is the dialect’s double type and an aggregate.

§Examples

assert_eq!(total(users.age).sql(), r#"TOTAL ("users"."age")"#);