Window
BOOL_OR()
Overview
The BOOL_OR()
window function evaluates whether at least one value within a specified window of rows is TRUE
.
Syntax
The syntax for this function is as follows:
Parameters
expression
: column or expression that the function operates on. It should evaluate to a boolean value (TRUE
orFALSE
)
Example
For the needs of this section, we will use 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 database website.
The query below uses the BOOL_OR()
function to evaluate whether at least one film in each rating category have a length greater than 150:
By executing the above query, we will get the following output: