IN and LIKE Operators
The LIKE operator allows you to search within the values of the attributes of a part, and uses wild cards, which are used to query similar values, but the IN operator returns precise record sets based on specific values and is a shortcut for multiple OR conditions.
IN Operator
The IN operator needs a series of values separated by a comma, for example - Value1,
Value2, Value3
. Internally, WA will convert that to
Value1 OR Value2 OR Value3
. Thus the IN operator saves you the effort of
creating multiple queries and combining them using OR operators.
The NOT IN
operator will be converted to NOT (Value1 OR Value2 OR
Value3)
.
LIKE Operator
TThe LIKE operator is a powerful operator because it supports multiple ways in which the attributes can be searched. The following table shows the various ways the search string can be specified using the LIKE operator.
Value | Description |
---|---|
AAA |
When the search string is used as is, the system will show the results where the
search string AAA exists in the field value in any position. |
*AAA or %AAA |
When the search string is prefixed with a * (or %), the system will show the results
where the field value ends with AAA . |
AAA* or AAA% |
When the search string is suffixed with a * (or %), the system will show the results
where the field value begins with AAA . |
A*B or A%B |
When the search string is specified with a * (or %) in between the search characters,
the system will show the results where the field value begins with A and
ends with B . |
_AAA |
When the search string is prefixed with a _, the system will show the results where
the field value begins with exactly one character before the string AAA .
The number of _s's will decide how many characters before the search string are
acceptable. |
AAA_ |
When the search string is suffixed with a _, the system will show the results where
the field value ends with exactly one character after the string AAA . The
number of _s's will decide how many characters after the search string are
acceptable. |
A_B |
When the search string is specified with a _ in between the search characters, the
system will show the results where the field value begins with A and ends
with B with only one character in between A and
B . The number of _s's will decide how many characters in between the
search strings are acceptable. |
____ |
When the search string is specified with just _s, then the field values which contain only the number of specified _s will be returned. The characters can be anything but should only match the number of _s's. |
Attribute | Operator | Values | Logical Operator |
---|---|---|---|
Description | LIKE |
CABIN* |
NOT LIKE
operator is similar to the LIKE
operator,
but negates and extracts the reversed results. This search query will, therefore, return all
parts that have a description beginning with CABIN
.