Show TOC Start of Content Area

This graphic is explained in the accompanying text Boolean Expressions  Locate the document in its SAP Library structure

The Boolean operators AND, OR and NOT allow combining multiple search conditions to complex Boolean expressions.

The result of the Boolean operations is given in the following tables:

AND

AND

true

false

unknown

True

true

false

unknown

False

false

false

false

unknown

unknown

false

unknown

 

OR

OR

true

false

unknown

true

true

true

true

false

true

false

unknown

unknown

true

unknown

unknown

 

NOT

NOT

true

false

unknown

 

false

true

unknown

 

Syntax

This graphic is explained in the accompanying text

<boolean expression> ::= <boolean term>
                                       | <search condition> OR <boolean term>.

<boolean term> ::= <boolean factor>
                             | <boolean term> AND <boolean factor>.

<boolean factor> ::=
           ( NOT )?
( <predicate>
                        |
'(' <search condition> ')' ).

Example

This graphic is explained in the accompanying text

SELECT * FROM employees
         WHERE employee_name LIKE 'John%'
            OR NOT ( salary > 50000
                     AND employee_name = 'Mary Jones')

Boolean Operations. The query selects all employees with a name starting with 'John' or with a salary not exceeding 50000 or  with a name equal to 'Mary Jones'.

More Information

Search Condition

End of Content Area