Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding parentheses
Message
From
22/09/2015 16:13:24
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01624934
Message ID:
01624943
Views:
40
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform