Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding parentheses
Message
De
22/09/2015 16:02:57
 
 
À
22/09/2015 13:41:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01624934
Message ID:
01624941
Vues:
52
>In this WHERE clause, I have parentheses:
>
>
>WHERE Client.NoProvince=@NoProvince AND
> NOT (Client.Status<@Status AND Client.NoStatus=@NoStatus) AND
> NOT (Client.Status<@Status2 AND Client.NoStatus=@NoStatus2) AND
> NOT (Client.Status<@Status3 AND Client.NoStatus=@NoStatus3) AND
> NOT (Client.Status<@Status4 AND Client.NoStatus=@NoStatus4) AND
> Client.NoCountry IN (1,2,3,4,5,6,7) AND
> Client.FirstName LIKE @LXList1Clm_No
>
>
>Would there be a way to avoid the parentheses? I see the execution is much smarter without those.

"not (A and B)" is the same as "(not A) or (not B)"

"not (A or B)" is the same as "(not A) and (not B)"

http://mathworld.wolfram.com/deMorgansLaws.html
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform