Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IN (SQL Server Compact Edition)
Collapse the table of content
Expand the table of content

IN (SQL Server Compact Edition)

Determines whether a given value matches any value in a subquery or a list.


test_expression [ NOT ] IN 
   ( subquery 
      | expression [ ,...n ] 
   ) 

test_expression

Any valid expression in Microsoft SQL Server 2005 Compact Edition.

subquery

A subquery that has a result set of one column. This column must have the same data type as test_expression.

expression [ ,... n]

A list of expressions to test for a match. All expressions must be of the same type as test_expression.

If the value of test_expression is equal to any value returned by subquery, or is equal to any expression from the comma-separated list, then the return value is TRUE. Otherwise, the return value is FALSE.

Using NOT IN negates the returned value.

The following example selects all customers in a table who are from Brazil, Argentina, and Venezuela.

SELECT * FROM Customers WHERE Country IN ('Brazil', 'Argentina', 'Venezuela')

Community Additions

ADD
Show:
© 2015 Microsoft