Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Instead of OR in WHERE clause
Message
 
 
To
03/02/2014 23:05:28
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01593065
Message ID:
01593078
Views:
22
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform