Skip to main content
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

ParameterDescriptionSupported input types
<expression>The boolean expression used to calculate the resultBOOLEAN
<condition>An optional boolean expression to filter rows used in aggregationBOOL

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 nulltotalprizedollars int null
The Drifting Thunderdome24768
The Talladega Thrill24747
The Elite Speed Demons Cup24346
The Volcanic Venture Rally24323
The Drifting Wasteland24271

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