Complex Boolean expressions
In a complex WHERE clause, Boolean operators combine multiple conditions.
The following example combines a function with a complex
qualification:
WHERE year > 95 AND (quarter = 1 OR quarter = 3)
The
OR operator combines two functions, equal(quarter,1)
and equal(quarter,3)
.
If either is true, the combination is true. The AND operator combines
the result of the greaterthan(year,95)
with the result
of the Boolean OR operator.
If a WHERE clause contains multiple conditions, the database server constructs a qualification descriptor that contains multiple, nested qualification descriptors.
The
following figure shows a complex WHERE clause that contains multiple
levels of qualifications. At each level, a Boolean operator combines
results from two previous qualifications.
Function
nesting and Qualification- descriptor
hierarchy for a three-key index represent the structure
of the qualification descriptor that corresponds to the WHERE clause
in Complex WHERE clause.
The qualification descriptors for the preceding expression
have a hierarchical relationship, as the following figure shows.