Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-02-09 : 11:01:49
|
| When i have multiple and conditions i can use in, this way:WHERE People.Name in ('Jeff','Bill','Pete','Eddy','John Doe','Mike') Using not inWHERE People.Name not in ('Jeff','Bill','Pete','Eddy','John') How can i use 'OR' operator similar to the above:where Myorderhistory Or('AD345','TRY234',JACOBS32')Thank you very much for the helpful info. |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-09 : 11:27:14
|
| WHERE People.Name in ('Jeff','Bill','Pete','Eddy','John Doe','Mike') this is not performing ANDRather its a form of OR and can be rewritten as Where(people.name ='Jeff' ORpeople.name ='Bill' ORpeople.name ='pate' ORpeople.name ='abc' ORpeople.name ='xyz') |
 |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-02-09 : 13:53:54
|
| I have almost 16 fields to use 'or' - is there an easy way on the sql server sp. |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-02-09 : 14:10:57
|
| Using IN is probably easiest or maybe even making a table of the "Good" values.JimEveryday I learn something that somebody else already knew |
 |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-02-09 : 15:43:59
|
| How do you use in with OR operator?I am looking for something easy if using In is possible. can you please provide an example.Thank you. |
 |
|
|
|
|
|
|
|