SOQL Logical Operators
When we need to filter rows using several conditions, we have to use Logical operators allow you to apply multiple comparison operators in one query.
Here is a list of logical operators available in SOQL:
The SQL AND
operator
Allows you to select only rows that satisfy two conditions.
Example: Find all clinics which are open on holidays in Florida.
The SQL OR
operator
Allows you to select rows that satisfy either of two conditions.
Example: Find all clinics which are located in Florida or Chicago
The SQL NOT
operator
Allows you to select rows that do not match a certain condition.
Example: Find all clinics which are NOT located in Florida or Chicago.