first
aggregate function
Returns the first value of expr
for a group of rows.
Arguments
expr
: An expression of any type.ignoreNull
: An optional BOOLEAN literal defaulting to false. The default forignoreNull
is 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
.
Returns
The result has the same type as expr
.
first is a synonym for first_value aggregate function.
This function is non-deterministic.