pub fn mod_<'a, V, E1, E2>(
dividend: E1,
divisor: E2,
) -> SQLExpr<'a, V, E1::SQLType, <E1::Nullable as NullOr<E2::Nullable>>::Output, Scalar>Expand description
MOD - returns the remainder of division (using % operator).
Returns the same type as the dividend. The result is nullable if either input is nullable.
Named mod_ to avoid conflict with Rust’s mod keyword.
Note: Uses the % operator which works on both SQLite and PostgreSQL.
§Example
ⓘ
use drizzle_core::expr::mod_;
// SELECT users.value % 3
let remainder = mod_(users.value, 3);