pub fn least<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<'a, V, L::SQLType, <L::Nullable as NullAnd<R::Nullable>>::Output, <L::Aggregate as AggOr<R::Aggregate>>::Output>where
V: SQLParam + 'a,
V::DialectMarker: PostgresNullSupport,
L: Expr<'a, V>,
R: Expr<'a, V>,
L::SQLType: Compatible<R::SQLType>,
L::Nullable: NullAnd<R::Nullable>,
R::Nullable: Nullability,
L::Aggregate: AggOr<R::Aggregate>,
R::Aggregate: AggregateKind,Expand description
LEAST - returns the smallest of the given values (PostgreSQL).
Both arguments must have compatible types. PostgreSQL ignores NULL inputs,
so LEAST(1, NULL) returns 1. The result is only NULL when all
inputs are NULL.
ยงExample
use drizzle_core::expr::least;
// Cap at maximum of 100
let score = least(users.score, 100);