Conditions.bool-primary-like
Returns True if a value matches a given pattern
Format
expression [ NOT ] LIKE Pattern [ ESCAPE Escape ]
Remarks
Checks if a string value matches a given pattern. Where Pattern is a string expression and Escape if specified is a string expression of length one (i.e. a single character).
Characters within Pattern are interpretted as follows unless an ESCAPE clause is specified.
- The underscore character (_) stands for any single charcter.
- The percent character (%) stands for any sequence of n characters where n can be zero.
- All other characters stand for themselves.
If an ESCAPE clause is specified then this character can be placed before a wildcard (_ or %) in Pattern to allow for an exact match on the usual wildcard character.
The LIKE predicate returns Unknown if any of the operands are NULL.
Example 1: Find all objects with a name begining 'Flow'.
SELECT NAME FROM CDBObject WHERE NAME LIKE 'Flow%'
Example 2: Find all objects with a name begining with an underscore.
SELECT NAME FROM CDBObject WHERE NAME LIKE '=_%' ESCAPE '='