FIRST_VALUE
Returns the first value within an ordered group of a result set.
Syntax
FIRST_VALUE(expression) OVER ( [PARTITION BY partition_expression] [ORDER BY order_expression] [ (ASC | DESC) ] ) → same as input type
expression: The expression that determines the return value.
partition_expression: An optional expression that groups rows into partitions. You can specify a single expression or a comma-separated list of expressions. For example,
PARTITION BY column1, column3, …
order_expression: An expression that specifies the order of the rows within each partition. You can specify a single expression or a comma-separated list of expressions. For example,
PARTITION BY column1, column3, …
Examples
FIRST_VALUE example
Last updated