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.

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:

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 '='


Disclaimer

Geo SCADA Expert 2022