OR

OR logical operator works in the following way:

  • If either expression is true, then the result is true.
  • If both expressions are false, then the result is false.

If you combine filters using OR, then the result is computed individually for each filter and the results are combined.

Examples:

In the following example, all metric values associated with the attribute values 2006 and 2005 will be returned.

SELECT Revenues WHERE Year = 2006 OR Year = 2005

OR can also be used to combine two different types of filters. Consider the case where you want to return the total of all payments from the year 2006 and the first four months of 2007:

SELECT SUM(Payment) WHERE Year = 2006 OR Month IN (January 2007, February 2007, March 2007, April 2007)