Developing By Me

Project Development and Design

IN Condition

IN Condition

The IN statement checks to see if the field is within the listed values after the IN. The array can be a specific set of literal values, variables, or it can be a query result. If a subquery is used it can only have a single returned column.

 

Operator SQL Syntax Description
IN field1 IN (1,2,3,4,5) The set in the parentheses can be numeric or text literals
IN field1 IN (@var1,@var2,table2.field5) The set can also be variables or fields.
IN field2 IN (SELECT field2 FROM table3) The set can be the return from a subquery which should only return one column.

%d bloggers like this: