Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instead of OR in WHERE clause
Message
 
 
À
03/02/2014 23:05:28
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01593065
Message ID:
01593078
Vues:
23
>>I am also not sure about your 1000 primary keys - why is it relevant?
>
>Because I prefer to use a 1k SQL command with 1000 OR conditions than to repeat the 1k line 1000 times with one condition.
>
>>In any case, you asked what can be used instead of OR and I gave you the answer.
>
>Yes, but it wouldn't apply here.

You don't need to use 1 condition per select. Split them in 2 equal parts.

There is no other magic bullet, I think, except for the case when all conditions are for the same column. In this case you would use IN subselect.
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