ANY_VALUE() OVER ...
All functions > WINDOW FUNCTION > ANY_VALUE() OVER ...
Returns an arbitrary non-null value from the window frame, if one exists.
Syntax
Diagram(
Sequence(
Terminal("ANY_VALUE"),
Terminal("("),NonTerminal('expr'),Terminal(")"),
Terminal("OVER"),
Terminal("("),
NonTerminal("over_clause"),
Terminal(")"),
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
expr | EXPRESSION | Yes | Expression to get any value from |
over_clause | OVER CLAUSE | Yes | OVER (PARTITION BY ... ORDER BY ... [FRAME ...]) |
Notes
- Returns any non-null value from the window frame
- Useful when you need a representative value but don't care which one
- Returns same type as input expression
- Non-deterministic: result may vary between executions