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 |
dougancil
Posting Yak Master
217 Posts |
Posted - 2011-05-09 : 12:04:12
|
I am trying to select * from a table where a value is equal to 'Vacation' 'Holiday' 'ETO' or 'Sicktime' and I keep getting a syntax error. What's the best way to write this query?I thought I could do SELECT * from table where code = 'Vacation' or 'Holiday' or 'ETO' or 'Sicktime' but that's not working. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-05-09 : 12:08:25
|
Eithere repeat code = 'vacation' or code = 'Holiday' etc or betterwhere code IN ('Vacation','Holiday',etc.)JimEveryday I learn something that somebody else already knew |
|
|
dougancil
Posting Yak Master
217 Posts |
Posted - 2011-05-10 : 17:18:31
|
Thank you Jim. Thats what I needed. |
|
|
|
|
|