Comparison Operators and Predicates

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Comparison operators and predicates compare values and return a boolean result. Use them to:

  • Compare two values with the standard relational operators.
  • Test ranges with BETWEEN.
  • Handle NULL and boolean states with NULL-aware and truth-value predicates.
  • Compare against a set of values with IN, ANY/SOME, and ALL.

Considerations 

  • Ordinary comparison operators yield NULL (signifying “unknown”) if either input is NULL. To compare NULL as an ordinary value, use the IS [NOT] DISTINCT FROM predicates.
  • IN/NOT IN and the array quantifiers compare a value against multiple values without a subquery. For the subquery forms of these constructs, see Subquery Comparisons.

Operators 

Compare two values:

Range and Null Tests 

Test ranges, NULL values, and boolean truth values:

  • BETWEEN — Test whether a value falls within an inclusive range.
  • Null and Boolean Predicates — Test for NULL values and boolean truth values, including NULL-safe comparisons.

Set Membership and Quantifiers 

Compare a value against a set of values:

Related Documentation