[NOT] IN (Entity SQL)
Determines whether a value matches any value in a collection.
value [ NOT ] IN expression
- value
Any valid expression that returns the value to match.
- [ NOT ]
Specifies that the Boolean result of IN be negated.
- expression
Any valid expression that returns the collection to test for a match. All expressions must be of the same type or of a common base or derived type as value.
true if the value is found in the collection; null if the value is null or the collection is null; otherwise, false. Using NOT IN negates the results of IN.
The following Entity SQL query uses the IN operator to determine whether a value matches any value in a collection. The query is based on the AdventureWorks Sales Model. To compile and run this query, follow these steps:
Follow the procedure in How to: Execute a Query that Returns StructuralType Results (EntityClient).
Pass the following query as an argument to the
ExecuteStructuralTypeQuery
method:
SELECT VALUE product FROM AdventureWorksEntities.Product
AS product WHERE product.ListPrice IN {125, 300}
The output is shown below:
ProductID: 842
Name: Touring-Panniers, Large
ProductNumber: PA-T100
MakeFlag: False
...