Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Data Types and Expressions > Condition >

Comparison Conditions (Boolean Expressions)

Five kinds of comparison conditions exist: Relational Operator, BETWEEN, IN, IS NULL, and LIKE and MATCHES. Comparison conditions are often called Boolean expressions because they return a TRUE or FALSE result. Their syntax is summarized in this diagram and explained in the sections that follow.

Read syntax diagramSkip visual syntax diagramComparison Conditions:
 
                    (1)                           (2)                  (1)
|--+-| Expression |-------| Relational Operator |-------| Expression |--------------------------------------+--|
   |                (1)                                    (1)                       (1)                    |
   +-| Expression |-------+-----+--BETWEEN--| Expression |-------AND--| Expression |------------------------+
   |                      '-NOT-'                                                                           |
   |  (3)                    (4)                                                                            |
   +--------| IN Condition |--------------------------------------------------------------------------------+
   |                 (5)                                                                                    |
   +-| Column Name |-------IS--+-----+--NULL----------------------------------------------------------------+
   |                           '-NOT-'                                                                      |
   |                     (6)                                                      (6)                       |
   '-+-| Quoted String |------+--+-----+--+-LIKE-----------+--+-| Quoted String |-------+---------------+-+-'
     |                 (5)    |  '-NOT-'  |  (3)           |  |                         '-ESCAPE 'char'-' |
     '-| Column Name |--------'           '--------MATCHES-'  |                 (5)                       |
                                                              '-| Column Name |---------------------------'
 

Notes:
  1. See page Expression
  2. See page Relational Operator
  3. Informix extension
  4. See page IN Condition
  5. See page Column Name
  6. See page Quoted String

Element Description Restrictions Syntax
char An ASCII character to be the nondefault escape character in the quoted string. Single ( ' ) and
double ( " ) quotation marks are not valid as char.
See ESCAPE with LIKE and ESCAPE with MATCHES. Quoted String,
p. Quoted String

The following sections describe the different types of comparison conditions:

For a discussion of comparison conditions in the context of the SELECT statement, see Using a Condition in the WHERE Clause.

Warning:
A literal date or DATETIME value in a comparison condition should specify 4 digits for the year. When you specify a 4-digit year, the DBCENTURY environment variable has no effect on the result. When you specify a 2-digit year, DBCENTURY can affect how the database server interprets the comparison condition, which might not work as you intended. For more information, see the IBM Informix Guide to SQL: Reference.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]