Specifications
CHAPTER 5 Defining Reports
Users Guide 161
Comparison operators
You can use the LIKE, NOT LIKE, IN, and NOT IN operators to compare
expressions.
Use
LIKE to search for strings that match a predetermined pattern. Use NOT
LIKE
to find strings that do not match a predetermined pattern. When you use
LIKE or NOT LIKE, you can use wildcards:
• The percent sign (%), like the wildcard asterisk (*) used in many
applications, matches multiple characters. For example,
Good% matches all
names that begin with
Good.
• The underscore character (_) matches a single character. For example,
Good _ _ _ matches all seven-letter names that begin with Good.
Use
IN to compare and include a value that is in a set of values. Use NOT IN to
compare and include values that are not in a set of values. For example, the
following clause selects all employees in department 100, 200, or 500:
SELECT * from employee
WHERE dept_id IN (100, 200, 500)
Using NOT IN in this clause would exclude employees in those departments.
Connection operators
You can use the OR and AND logical operators to connect expressions.
InfoMaker makes some assumptions based on how you specify selection
criteria. When you specify:
• Criteria for more than one column on one line
InfoMaker assumes a logical
AND between the criteria. A row from the
database is retrieved if all criteria in the line are met.
• Two or more lines of selection criteria
InfoMaker assumes a logical
OR. A row from the database is retrieved if
the criterion in any of the lines is met.
To override these defaults, begin an expression with the
AND or OR operator:
This technique is particularly handy when you want to retrieve a range of
values in a column. See example 6 below.
Operator Meaning
OR The row is selected if one expression OR another expression is true
AND The row is selected if one expression AND another expression are true