次の方法で共有


! (NOT) (Entity SQL)

Boolean 型の式を否定します。

NOT boolean_expression
or
!  boolean_expression  

引数

  • boolean_expression
    ブール値を返す任意の有効な式。

解説

感嘆符 (!) には、NOT 演算子と同じ機能があります。

次の Entity SQL クエリでは、NOT 演算子を使用して Boolean 型の式を否定します。 このクエリは、AdventureWorks Sales Model に基づいています。 このクエリをコンパイルして実行するには、次の手順を実行します。

  1. Follow the procedure in StructuralType 結果を返すクエリの実行方法 (EntityClient).

  2. Pass the following query as an argument to the ExecuteStructuralTypeQuery method:

-- 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)

参照

概念

Entity SQL リファレンス