Skip to main content

right

Function right 

Source
pub fn right<'a, V, E, N>(
    expr: E,
    n: N,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Text, E::Nullable, <E::Aggregate as AggOr<N::Aggregate>>::Output>
Expand description

RIGHT - returns the last n characters of a string (PostgreSQL).

Preserves the nullability of the input expression.

ยงExample

use drizzle_core::expr::right;

// SELECT RIGHT(users.phone, 4)
let last_four = right(users.phone, 4);