NOT (!) (Entity SQL)

Nega un'espressione Boolean.

NOT boolean_expression
or
! boolean_expression

Argomenti

  • boolean_expression
    Qualsiasi espressione valida che restituisce un valore Boolean.

Osservazioni

Il punto esclamativo (!) ha la stessa funzionalità dell'operatore NOT.

Esempio

Nella query Entity SQL seguente viene utilizzato l'operatore NOT per negare un'espressione Boolean. La query è basata sul modello Sales di AdventureWorks. Per compilare ed eseguire questa query, effettuare le operazioni seguenti:

  1. Seguire la procedura indicata in Procedura: eseguire una query che restituisce risultati StructuralType (EntityClient).

  2. Passare la query seguente come argomento al metodo ExecuteStructuralTypeQuery:

\\ NOT
SELECT VALUE product FROM AdventureWorksEntities.Product 
                                    AS product where product.ListPrice > 50 AND NOT (product.ListPrice = 90)
\\ !
SELECT VALUE product FROM AdventureWorksEntities.Product 
                                    AS product where product.ListPrice > 50 AND ! (product.ListPrice = 90)

Di seguito viene riportato l'output:

ProductID: 514
Name: LL Mountain Seat Assembly
ProductNumber: SA-M198
MakeFlag: True
ProductID: 515
Name: ML Mountain Seat Assembly
ProductNumber: SA-M237
MakeFlag: True
ProductID: 516
Name: HL Mountain Seat Assembly
ProductNumber: SA-M687
MakeFlag: True
ProductID: 517
Name: LL Road Seat Assembly
ProductNumber: SA-R127
MakeFlag: True
ProductID: 518
Name: ML Road Seat Assembly
ProductNumber: SA-R430
MakeFlag: True

Vedere anche

Concetti

Operatori logici (Entity SQL)
Riferimenti a Entity SQL