Siebel Search Administration Guide > Syntax for Filter Search Specifications > Filter Search Specification Syntax >

Pattern Matching with LIKE and NOT LIKE


The LIKE operator is used in character string comparisons with pattern matching.

The syntax is as follows:

char1 LIKE char2

where:

  • char1 is the value to be compared with the pattern.
  • char2 is the pattern to which char1 is compared. The NOT logical operator can be used in conjunction with LIKE to exclude patterns.

    The syntax including the NOT logical operator is one of the following:

    char1 NOT LIKE char2

    NOT (char1 LIKE char2)

    While the equal (=) operator does exact matching, the LIKE operator matches a portion of one character value to another. Patterns can use special characters to denote different characters. These characters are given in Table 23.

    Table 23. Pattern Matching Using Special Characters
    Character
    Purpose
    Example

    *

    Zero or more characters

    [Sales Type] LIKE Sales* returns all records whose [Sales Type] value starts with the characters Sales, as in Sales-Brochure, Sales-Presentation, and so on.

    ?

    One character

    [Sales Type] NOT LIKE Sale? returns all records whose [Sales Type] value was five characters long, and did not start with the letters Sales. Records with the word Sales would not be returned.

  • Siebel Search Administration Guide Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.