IN Condition
The IN condition is satisfied when the expression to the left of
the keyword IN is included in the list of items.
(explicit id incon003)
incon003
(explicit id incon004)
incon004
(explicit id incon005)
incon005
(explicit id incon006)
incon006
(explicit id incon007)
incon007
(explicit id incon008)
incon008
(explicit id incon009)
incon009
(explicit id incon010)
incon010
IN Condition
<Expression>[]
[ NOT ]
IN
{ ( { | <Literal Number>[] | <Literal DATETIME>[] | <Quoted String>[] | <Literal INTERVAL>[] | USER | CURRENT_USER | TODAY | CURRENT [ <DATETIME Field Qualifier> [] ] | SITENAME | DBSERVERNAME | <Literal Row>[] } ) | { collection_col | ( <Literal Collection>[] ) | <Literal Collection> [] } }
Element | Description | Restrictions | Syntax |
---|---|---|---|
collection_col | Name of a collection column that is used in an IN condition | The column must exist in the specified table | Identifier |
If you specify the NOT operator, the IN condition is TRUE
when
the expression is not in the list of items. NULL values do not satisfy
the IN condition.
The following examples show some IN conditions:
WHERE state IN ('CA', 'WA', 'OR')
WHERE manu_code IN ('HRO', 'HSK')
WHERE user_id NOT IN (USER)
WHERE order_date NOT IN (TODAY)
In Informix® ESQL/C, the built-in TODAY function is evaluated at execution time. The built-in CURRENT function is evaluated when a cursor opens or when the query executes, if it is a singleton SELECT statement.
The built-in USER function is case sensitive; for example, it interprets minnie and Minnie as different values.
1 See Expression
2 See Literal Number
3 See Literal DATETIME
4 See Quoted String
5 See Literal INTERVAL
7 See Literal Row
8 See Literal Collection