pub fn left<'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>where
V: SQLParam + 'a,
V::DialectMarker: LeftRightSupport,
E: Expr<'a, V>,
E::SQLType: Textual,
N: Expr<'a, V>,
N::SQLType: Integral,
N::Nullable: Nullability,
E::Nullable: NullOr<N::Nullable>,
N::Aggregate: AggregateKind,
E::Aggregate: AggOr<N::Aggregate>,Expand description
LEFT - returns the first n characters of a string (PostgreSQL and MySQL).
The result is nullable when either argument is nullable.
ยงExample
use drizzle_core::expr::left;
// SELECT LEFT(users.name, 3)
let prefix = left(users.name, 3);