max_by
aggregate function (Databricks SQL)
Returns the value of an expr1
associated with the maximum value of expr2
in a group.
Arguments
expr1
: An expression of any type.expr2
: An expression of a type that can be ordered.cond
: An optional boolean expression filtering the rows used for aggregation.