Page 5 of 9PREVNEXT

Queries V: Use And, Or, and In to set multiple conditions

The difference between And and Or

When you specify multiple conditions, it's important to understand the difference between the And and Or operators.

Callout 1 The And operator is restrictive. It only retrieves data that meets all the conditions you specify. In this case, both conditions must apply, so the query returns less data.
Callout 2 The Or operator is more flexible. It returns data that meets any of the conditions you specify. In this case, either condition can apply, so your query returns more data.

Knowing how each operator works can help you troubleshoot a query. If you see too few or no results, you may have mistakenly used And instead of Or. For example, suppose you want all the customers in Germany and France. If you use "Germany" And "France" in your query, you won't see any results because the same customer can't live in both locations at once.

Page 5 of 9PREVNEXT