Function quaint::ast::sum

source ·
pub fn sum<'a, E>(expr: E) -> Function<'a>where
    E: Into<Expression<'a>>,
Expand description

Calculates the sum value of a numeric column.

let query = Select::from_table("users").value(sum(col!("age")).alias("sum"));
let (sql, _) = Sqlite::build(query)?;
assert_eq!("SELECT SUM(`age`) AS `sum` FROM `users`", sql);