Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CASE WHEN based on select
Message
 
 
À
13/04/2015 12:02:19
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:
01618310
Message ID:
01618319
Vues:
28
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform