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.
Negates a Boolean expression.
Syntax
NOT boolean_expression
-- or
! boolean_expression
Arguments
boolean_expression
Any valid expression that returns a Boolean.
Remarks
The exclamation point (!) has the same functionality as the NOT operator.
Example
The following Entity SQL query uses the NOT operator to negates a Boolean expression. 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:
-- NOT
SELECT VALUE product FROM AdventureWorksEntities.Products
AS product WHERE product.ListPrice > @price1 AND NOT (product.ListPrice = @price2)
-- !
SELECT VALUE product FROM AdventureWorksEntities.Products
AS product WHERE product.ListPrice > @price1 AND ! (product.ListPrice = @price2)