> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# BOOL_OR

> Returns true if any non-NULL input is true.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Aggregate · Window</span></div>

NULLs are ignored. All-NULL inputs yield NULL; all non-NULL FALSE values yield FALSE.

## 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. A frame from `UNBOUNDED PRECEDING` to `UNBOUNDED FOLLOWING` includes every row in the group.

### Aggregate

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
bool_or([DISTINCT] value)
```

### Window

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
bool_or(value) OVER ([PARTITION BY key] [ORDER BY ordering_key] [ROWS BETWEEN UNBOUNDED PRECEDING AND bound])
```

* 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.

### Window over all rows in each group

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
bool_or(value) OVER ([PARTITION BY key] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
```

* This window form evaluates BOOLEAN values across all rows in the group. Sliding frames are not supported.

## Arguments

### Aggregate and window

| Name | Type | Required | Description |
| - | - | - | - |
| value | BOOLEAN | Yes | Boolean values whose truth values are combined. |

## Returns

* Type: BOOLEAN
* NULL behavior: NULLs are ignored. All-NULL inputs yield NULL; all non-NULL FALSE values yield FALSE.
* Empty input: Returns NULL on empty global aggregate or frame.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports DISTINCT | Partial (Removing duplicate values does not change the result.) |
| Supports window usage | Partial (Use all rows in the group or start at its first row. Sliding frames and RANGE offsets are not supported.) |
| Supports window frames | Partial (Use all rows in the group or start at its first row. Sliding frames and RANGE offsets are not supported.) |
| Exact result | Yes |

## Usage notes

* In grouped calls, BOOL\_OR returns the maximum BOOLEAN value: TRUE takes precedence over FALSE.
* DISTINCT has no effect on Boolean OR.

## Examples

### Any true input

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
WITH t("value") AS (VALUES (FALSE), (TRUE), (FALSE)) SELECT bool_or("value") AS result FROM t;
```

| result |
| - |
| true |

### All NULL values

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
WITH t("value") AS (VALUES (CAST(NULL AS BOOLEAN)), (CAST(NULL AS BOOLEAN))) SELECT bool_or("value") AS result FROM t;
```

| result |
| - |
| NULL |

### Boolean OR across all rows in each group

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
WITH t(id,"value") AS (VALUES (1,FALSE),(2,TRUE),(3,CAST(NULL AS BOOLEAN))) SELECT id,bool_or("value") OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS result FROM t ORDER BY id;
```

| id | result |
| - | - |
| 1 | true |
| 2 | true |
| 3 | true |

## Limitations

* 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.