Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

Logical Operators: OR, AND, NOT

Logical operators combine multiple search conditions. FairCom DB SQL evaluates multiple search conditions in this order:

  1. Search conditions enclosed in parentheses. (For nested search conditions in parentheses, FairCom DB SQL evaluates the innermost search condition first.)
  2. Search conditions preceded by NOT
  3. Search conditions combined by AND
  4. Search conditions combined by OR

Examples

SELECT *

FROM customer

WHERE name = 'LEVIEN' OR name = 'SMITH' ;

SELECT *

FROM customer

WHERE city = 'PRINCETON' AND state = 'NJ' ;

SELECT *

FROM customer

WHERE NOT (name = 'LEVIEN' OR name = 'SMITH') ;

TOCIndex