Function diesel::dsl::sum

source ·
pub fn sum<ST: Foldable, expr>(
    expr: expr
) -> sum<ST, <expr as AsExpression<ST>>::Expression>where
    expr: AsExpression<ST>,
Expand description

Represents a SQL SUM function. This function can only take types which are Foldable.

Examples

assert_eq!(Ok(Some(12i64)), animals.select(sum(legs)).first(connection));