Export (0) Print
Expand All

LIKE Predicate

The LIKE predicate performs pattern-matching comparison on the specified column. It uses the following syntax:


...WHERE <column> LIKE '<wildcard_literal>'

The <column> can be a regular or delimited identifier. The column is limited to the properties in the property store.

The <wildcard_literal> is a string literal. It is enclosed in quotation marks and optionally can contain wildcard characters. The match string can contain multiple wildcard characters if needed. The following table describes the wildcard characters that the LIKE predicate recognizes.

WildcardDescriptionExample
% (percent)Matches zero or more of any characters.'comp%r' matches 'comp' followed by zero or more of any characters, ending in an r.
_ (underscore)Matches any single character.'comp_ter' matches 'comp' followed by exactly one of any character, followed by 'ter'.
[ ] (square brackets)Matches any single character within the specified range or set. For example, [a-z] specifies a range; [aeiou] specifies the set of vowels. 'comp[a-z]re' matches 'comp' followed by a single character in the range of a through z, followed by 're'.

'comp[ao]' matches 'comp' followed by a single character that must be either an a or an o.

[^ ] (caret)Matches any single character that is not within the specified range or set. For example, [^a-z] specifies a range that excludes a through z; [^aeiou] specifies a set that excludes vowels.'comp[^u]' matches 'comp' followed by any single character that is not a u.

 

If you create predicates with multiple ranges, the ranges must be in order.

Note  To match the wildcard characters as literal characters for matching and not as wildcard characters, place the character inside square brackets. For example, to match the percent sign, use '[%]'

Examples


...WHERE System.ItemNameDisplay LIKE 'financ%'

Related topics

Reference
Literal Value Comparison
Multi-Valued (ARRAY) Comparisons
NULL Predicate
Conceptual
Full-Text Predicates
Non-Full-Text Predicates

 

 

Community Additions

ADD
Show:
© 2014 Microsoft