Returns true if any non NULL input value is true, otherwise false. If all input values are NULL values, returns NULL.
Syntax
BOOL_OR(<expression>) [FILTER ([WHERE] <condition>)]
Parameters
| Parameter | Description | Supported input types |
|---|
<expression> | The boolean expression used to calculate the result | BOOLEAN |
<condition> | An optional boolean expression to filter rows used in aggregation | BOOL |
Return Types
BOOLEAN
Example
The following query shows the tournaments with the highest prize amounts in the tournaments table:
SELECT name, totalprizedollars FROM tournaments ORDER BY totalprizedollars DESC LIMIT 5;
| name text null | totalprizedollars int null |
|---|
| The Drifting Thunderdome | 24768 |
| The Talladega Thrill | 24747 |
| The Elite Speed Demons Cup | 24346 |
| The Volcanic Venture Rally | 24323 |
| The Drifting Wasteland | 24271 |
Rows: 5Execution time: 6.00ms
The following example checks whether any tournament in the tournaments table has a prize of more than 20,000:
SELECT BOOL_OR(totalprizedollars > 20000) AS has_big_prize FROM tournaments;
| has_big_prize boolean null |
|---|
| True |
Rows: 1Execution time: 5.78ms