please dont rip this site

LIKE Predicate

The LIKE predicate performs pattern-matching queries.

Syntax

Column_Reference [NOT] LIKE 'String_Pattern '

Elements

Column_Reference   Specifies the column name (alias). Its data type must be compatible with the format of the String_Pattern specified.
   
String_Pattern  

Specifies the literal of type Basic String to use as the pattern. You can use any combination of string literals along with the valid wildcard characters shown in the following table:

Name Symbol Description
Percent % Matches 0 or more occurrences of the search pattern.
Underscore _ Matches any single character.
Square brackets [ ] Matches any single character within a specified range, inside the square brackets.
Caret [^] Matches any single character not within the specified range, inside the square brackets.

Note: To use the percent ( % ), underscore ( _ ),and left square bracket ( [ ) as literal characters in a LIKE search pattern rather than as wildcards, surround the characters with square brackets. The right square bracket ( ] ) matches itself unless preceded by a left square bracket. The range character ( - ) matches itself unless it is inside square brackets and preceded and followed by a single character.

The following illustrates using wildcards as literals:

Pattern                 Meaning
LIKE 'd%'d followed by any string of 0 or more characters
LIKE 'd[%]'d%
LIKE '_n'an, in, on, etc.
LIKE '[_]n'_n
LIKE '[a-cdf]'a, b, c, d, or f
LIKE '[-acdf]'-, a, c, d, or f
LIKE '[[]'[
LIKE ']']
LIKE '[ab]cd]e'acd]e, or bcd]e

Examples

  1. The following example returns rows consisting of the DocAuthor, DocTitle, and size properties for all files under the virtual roots /contracts and /legal, written by authors whose names are Smith, Smyth, Smythe, and so on, where the comment field of those documents does not contain words starting with "real", such as "realty" or "realtor".

    SELECT DocAuthor, DocTitle, size
    FROM SCOPE('"/contracts", "/legal"')
    WHERE DocAuthor LIKE 'SM_TH%'
       AND DocComments NOT LIKE 'REAL%'
  2. The following example returns rows consisting of the DocTitle and size properties for all files under the virtual roots /contracts and /legal, written by authors whose names begin with any characters except "A" through "F".

    SELECT DocTitle, size
    FROM SCOPE('"/contracts", "/legal"')
    WHERE DocAuthor LIKE '[^a-f]%'

© 1997 by Microsoft Corporation. All rights reserved.


file: /Techref/language/asp/ix/ixselik.htm, 5KB, , updated: 1997/9/29 03:23, local time: 2024/8/15 23:15,
TOP NEW HELP FIND: 
3.15.1.36:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/asp/ix/ixselik.htm"> SQL Access to Index Server Data: LIKE Predicate</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .