- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
- Window
- System
On this page
first, first_value
Returns the first input value.
Syntax
first( <expr> )
first_value( <expr> )
first returns the first value, including NULL. first_value returns the first non-NULL value.
Examples
VALUES (NULL), ('a'), ('b')
AGGREGATE first($0), first_value($0);