# bool_or

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: bool_or
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/window-functions/bool-or
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/window-functions/bool-or.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/window-functions/bool-or.adoc
description: The `bool_or()` window function evaluates whether at least one value within a specified window of rows is TRUE.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/window-functions/bool-or.md -->

The `bool_or()` window function evaluates whether at least one value within a specified window of rows is `TRUE`.

## [](#syntax)Syntax

The syntax for this function is:

```sql
BOOL_OR (expression) OVER (
    [PARTITION BY partition_expression]
    ORDER BY sort_expression
)
```

## [](#parameters)Parameters

-   `expression`: Column or expression that the function operates on. It should evaluate to a boolean value (`TRUE` or `FALSE`).


## [](#examples)Examples

This example uses a simplified version of the `film` table from the Pagila database, containing only the `title`, `length` and `rating` columns. The complete schema for the `film` table can be found on the [Pagila](https://www.postgresql.org/ftp/projects/pgFoundry/dbsamples/pagila/pagila/) database website.

```sql
DROP TABLE IF EXISTS film;
CREATE TABLE film (
  title text NOT NULL,
  length int,
  rating text
);
INSERT INTO film(title, length, rating) VALUES
  ('ATTRACTION NEWTON', 83, 'PG-13'),
  ('CHRISTMAS MOONSHINE', 150, 'NC-17'),
  ('DANGEROUS UPTOWN', 121, 'PG'),
  ('KILL BROTHERHOOD', 54, 'G'),
  ('HALLOWEEN NUTS', 47, 'PG-13'),
  ('HOURS RAGE', 122, 'NC-17'),
  ('PIANIST OUTFIELD', 136, 'NC-17'),
  ('PICKUP DRIVING', 77, 'G'),
  ('INDEPENDENCE HOTEL', 157, 'NC-17'),
  ('PRIVATE DROP', 106, 'PG'),
  ('SAINTS BRIDE', 125, 'G'),
  ('FOREVER CANDIDATE', 131, 'NC-17'),
  ('MILLION ACE', 142, 'PG-13'),
  ('SLEEPY JAPANESE', 137, 'PG'),
  ('WRATH MILE', 176, 'NC-17'),
  ('YOUTH KICK', 179, 'NC-17'),
  ('CLOCKWORK PARADISE', 143, 'PG-13');
```

This query uses the `bool_or()` function to evaluate whether at least one film in each rating category have a length greater than 150:

```sql
SELECT
   title,
   length,
   rating,
   BOOL_OR(length > 150) OVER (PARTITION BY rating) as ALLleastOneLongFilmsByRating
FROM film
ORDER BY rating;
```

The query returns:

```sql
        title        | length | rating | allleastonelongfilmsbyrating
---------------------+--------+--------+------------------------------
 KILL BROTHERHOOD    |     54 | G      | f
 PICKUP DRIVING      |     77 | G      | f
 SAINTS BRIDE        |    125 | G      | f
 CHRISTMAS MOONSHINE |    150 | NC-17  | t
 HOURS RAGE          |    122 | NC-17  | t
 PIANIST OUTFIELD    |    136 | NC-17  | t
 INDEPENDENCE HOTEL  |    157 | NC-17  | t
 FOREVER CANDIDATE   |    131 | NC-17  | t
 WRATH MILE          |    176 | NC-17  | t
 YOUTH KICK          |    179 | NC-17  | t
 DANGEROUS UPTOWN    |    121 | PG     | f
 PRIVATE DROP        |    106 | PG     | f
 SLEEPY JAPANESE     |    137 | PG     | f
 ATTRACTION NEWTON   |     83 | PG-13  | f
 HALLOWEEN NUTS      |     47 | PG-13  | f
 MILLION ACE         |    142 | PG-13  | f
 CLOCKWORK PARADISE  |    143 | PG-13  | f
(17 rows)
```