[NOT] IN

Compares one value to a list of values.

Syntax

expression [NOT] IN ( «expr»)

Parameters

expression

An expression that evaluates to either a number or a character string.

expr

A list of expressions whose values are to be compared to expression. Members of the list are separated from one another by commas.

Return Value

Logical

Comments

An IN comparison is logically true if expression is equal to at least one of the values in the specified list.

A NOT IN comparison is logically true if expression is not equal to any of the values in the specified list.

In either case, the comparison ends as soon as a logically true instance is found.

Example

The conditional expression that follows is logically true if the value of AirPollutants matches any of CFC, CO, or NOX.

AirPollutants in (" CFC","CO"," NOX")

The conditional expression that follows is logically true if the value obtained from either TicketAmt*5 or Receipts*10 equals 10,000.

10000 in ( TicketAmt * 5,Receipts * 10)

 

Related Topics