Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoiding parentheses
Message
De
22/09/2015 16:13:24
 
 
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:
01624943
Vues:
39
>So, can you translate these conditions into English? Is it the same as
>
>When NoStatus = @NoStatus you want rows with Status >=@Status
>for NoStatus = @NoStatus1 you want rows with Status >=@Status1

Yes, this is what it is.

>If my interpretation is correct and NoStatus can only be one of the 4 statuses, then you can convert this condition into CASE based.
>
>1 = case Client.NoStatus when @NoStatus
>then case when Client.Status >= @Status then 1 else 0 end
>when @NoStatus1
>then case when Client.Status >= @Status1 then 1 else 0 end
>etc.
>end
I will check the execution plan on such approach and I will let you know.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform