Aggregate · Window
Aliases: bit_or
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
- Use a frame that includes all rows in the group or starts at the first row (
UNBOUNDED PRECEDING). Sliding frames that drop earlier rows are not supported. RANGE frames with a numeric or time offset are not supported.
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
- FLOAT, DOUBLE, and DECIMAL inputs are not supported. Cast to an integer type before calling the function if integer conversion is appropriate for your data.
- BITORAGG returns the input integer type, although query tools may report BIGINT. The reported type does not widen the returned value.
- Use a frame that includes all rows in the group or starts at the first row (
UNBOUNDED PRECEDING). Sliding frames that drop earlier rows are not supported. RANGE frames with a numeric or time offset are not supported.
Last modified on October 15, 2026