IN Predicate

Tests set membership.

Syntax

Arguments

expression

specifies any valid SQL expression.

See <sql-expression>
FedSQL Expressions

select-statement

specifies a subquery with the SELECT statement.

See SELECT Statement

constant

specifies a number or a quoted character string (or other special notation) that indicates a fixed value. Constants are also called literals.

Details

The IN predicate tests whether the column value that is returned by the SQL expression on the left is a member of the set (of constants or values returned by the query expression) on the right. The IN condition is true if the value of the operand on the left is in the set of values that are defined by the operand on the right.
The NOT IN predicate negates the returned value.

Example

select city, country
   from worldtemps
      where avghigh in (90, 97);
SAS creates the following table:
IN Predicate Example Output Table
IN Predicate Example Output Table
Last updated: February 23, 2017