pub fn greatest<'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
GREATEST - returns the largest of the given values (PostgreSQL).
Both arguments must have compatible types. PostgreSQL ignores NULL inputs,
so GREATEST(1, NULL) returns 1. The result is only NULL when all
inputs are NULL.
ยงExample
use drizzle_core::expr::greatest;
// Clamp to minimum of 0
let score = greatest(users.score, 0);