first_value
aggregate function
Applies to: Databricks SQL Databricks Runtime
Returns the first value of expr
for a group of rows. This function is a synonym for first aggregate function.
Syntax
first_value(expr[, ignoreNull]) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the OVER
clause.
Arguments
expr
: An expression of any type.ignoreNull
: An optional BOOLEAN literal defaulting to false.cond
: An optional boolean expression filtering the rows used for aggregation.IGNORE NULLS
orRESPECT NULLS
: WhenIGNORE NULLS
is used orignoreNull
istrue
anyexpr
value that is NULL is ignored. The default isRESPECT NULLS
.