Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE WHEN based on select
Message
 
 
To
13/04/2015 12:02:19
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01618310
Message ID:
01618319
Views:
29
>>In your case the condition
>>
>>What has to be adjusted is that if the select has Company.Activated=True, I need to obtain 2. If it is False, I need to obtain 3.
>>
>>is reversed.
>
>Yes, I reversed it.
>
>>Also, do you have just one row in the company for numero and want to check if it's activated or not? You can change EXISTS to be
>>
>>(select 1 from Company where Numero = Client.NoCompany and Activated = 0)
>
>Yes, that is unique.

Ok, exists version should be better. Just use exists (select 1 from ...)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform