Aggregate · Window
NULLs are ignored; an all-NULL group or frame returns NULL.
Syntax
A window function keeps each input row and adds a result for that row. PARTITION BY groups rows with matching values; without it, all input rows form one group.
Aggregate
Window
- RANGE frames with a numeric or time offset are not supported. Use unique ORDER BY values for calculations that advance one row at a time. DISTINCT is not supported in these window forms.
Arguments
Aggregate and window
Returns
- Type: Same SQL type as value
- NULL behavior: NULLs are ignored; an all-NULL group or frame returns NULL.
- Empty input: Returns NULL on an empty global aggregate or empty frame.
Properties
Usage notes
- Use DISTINCT in grouped aggregation only. It does not provide duplicate removal in a window call.
Examples
Combine bits
Ignore NULLs
All NULL values
Limitations
- BIT_XOR does not support DISTINCT in sliding windows.
Last modified on October 15, 2026