# 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/aggregate-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/aggregate-functions/bool-or.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/aggregate-functions/bool-or.adoc
description: "The `bool_or()` function calculates all the boolean values in the aggregated group, which will have these results:"
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/aggregate-functions/bool-or.md -->

The `bool_or()` function calculates all the boolean values in the aggregated group, which will have these results:

-   `false` if all the values are `false` for every row.

-   `true` if at least one row in the group is true.


The input and the return type must be in `bool`.

> 📝 **NOTE**
>
> `NULL` values are not aggregated, so it returns `NULL` if there are zero input rows.

## [](#examples)Examples

This example uses a payment table that stores details of the orders, whether the order has been paid or unpaid by the customer:

```sql
CREATE TABLE payment (
    orderid int,
    custname text,
    orderproduct text,
    ordertotal real,
    paid boolean
);
INSERT INTO payment (orderid, custname, orderproduct, ordertotal, paid)
VALUES
(9557411, 'Maya', 'Jeans', 10.5, false),
(9557421, 'Aaron', 'T-Shirt', 9.2, false),
(9557451, 'Alex', 'Hat', 10.8, false),
(9557311, 'Will', 'Hat', 8.5, true),
(9557321, 'Will', 'T-Shirt', 12.15, false),
(9557351, 'Maya', 'T-Shirt', 9.5, true),
(9557221, 'Maya', 'Jeans', 11.02, false),
(9557251, 'Alex', 'Jeans', 11.09, false),
(9557231, 'Aaron', 'Hat', 14.56, false),
(9557281, 'Aaron', 'Hat', 12.15, false),
(9557291, 'Will', 'T-Shirt', 13.1, false);
```

```sql
SELECT * FROM payment;
```

This query shows the following table:

```sql
+----------+-----------+---------------+-------------+--------+
| orderid  | custname  | orderproduct  | ordertotal  | paid   |
+----------+-----------+---------------+-------------+--------+
| 9557411  | Maya      | Jeans         | 10.5        | f      |
| 9557421  | Aaron     | T-Shirt       | 9.2         | f      |
| 9557451  | Alex      | Hat           | 10.8        | f      |
| 9557311  | Will      | Hat           | 8.5         | t      |
| 9557321  | Will      | T-Shirt       | 12.15       | f      |
| 9557351  | Maya      | T-Shirt       | 9.5         | t      |
| 9557221  | Maya      | Jeans         | 11.02       | f      |
| 9557251  | Alex      | Jeans         | 11.09       | f      |
| 9557231  | Aaron     | Hat           | 14.56       | f      |
| 9557281  | Aaron     | Hat           | 12.15       | f      |
| 9557291  | Will      | T-Shirt       | 13.1        | f      |
+----------+-----------+---------------+-------------+--------+
```

### [](#bool_or-with-a-true-result)`bool_or` with a true result

To find out if all customers have paid for their orders, run the query:

```sql
SELECT BOOL_OR(paid) AS "final_result" FROM payment;
```

If there is at least one `TRUE` value, the overall result is `TRUE`. The output shows that some order has been paid regardless of the other unpaid orders.

```sql
+--------------+
| final_result |
+--------------+
| t            |
+--------------+
```

### [](#bool_or-with-a-false-result)`bool_or` with a false result

To find out if Aaron has paid for his orders, run the query:

```sql
SELECT BOOL_OR(paid) AS aaron_paid
FROM payment
WHERE custname ='Aaron';
```

If all values are `FALSE`, then the overall result is `FALSE`. The output shows that Aaron hasn’t paid for all his orders.

```sql
+------------+
| aaron_paid |
+------------+
| f          |
+------------+
```