Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simplifying WHERE clause with CASE WHEN
Message
 
 
À
21/04/2015 17:58:26
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:
01618887
Message ID:
01618917
Vues:
34
>>Well, to me the re-factored command is much easier to understand and debug. But it's up to you to take the suggestion and try it or not.
>
>This would be better:
>
>
>...
>     WHERE BusinessTime.NoProvince=
>      (SELECT COALESCE((SELECT Company.NoProvince FROM Company WHERE Company.NoCountry=1 AND Company.Numero=Client.NoCompany),84)) AND
>      BusinessTime.NoHoliday=0 AND
>      BusinessTime.Start<Client.FirstDate AND
>      BusinessTime.[End]>=Client.SecondDate) Temp)
>...
>
This would not work. You're not getting NULL, you're not getting result at all.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform