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 as NullOr<N::Nullable>>::Output, <E::Aggregate as AggOr<N::Aggregate>>::Output>
Expand description

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

The result is nullable when either argument is nullable.

ยงExample

use drizzle_core::expr::right;

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