CONTAINS / ICONTAINS
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Checks whether a string contains a specified substring or character value. CONTAINS performs a case-sensitive search, while ICONTAINS performs a case-insensitive search.
<string>: The string to search within.<substring>: The substring or character to search for.
Returns a boolean value indicating whether the string contains the substring, or NULL if either argument is NULL.
- Empty substring: An empty substring returns
truefor any non-NULL string. - Literal matching: Treats the
_and%characters as literal characters, not wildcards. - Collation support: Use collations for locale-aware matching, including case-insensitive (
_ci) and accent-insensitive (_ai) options.
Check whether a string contains a substring (case-sensitive).
Returns true.
Returns false because the case doesn’t match.
Check whether a string contains a substring (case-insensitive).
Returns true because icontains ignores case differences.
Returns NULL when either argument is NULL.
Returns NULL.
Returns NULL.
An empty substring is always contained in any string.
Returns true.
Matches the _ and % characters literally, not as wildcards.
Returns false because it treats _ as a literal underscore.
Returns true.
Use collations for locale-aware matching.
Performs a case-insensitive search using German locale rules.
Performs an accent-insensitive search using the US English locale rules, matching both "cafe" and "café".