Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Determines whether a value matches any value in a collection.
Syntax
value [ NOT ] IN expression
Arguments
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.
Return 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.
Example
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.
Pass the following query as an argument to the
ExecuteStructuralTypeQuerymethod:
SELECT VALUE product FROM AdventureWorksEntities.Products
AS product WHERE product.ListPrice IN {125, 300}