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 |
|
hasanali00
Posting Yak Master
207 Posts |
Posted - 2004-12-01 : 07:48:23
|
| I want to select 'cat' 'dog' from 'animal' columSo I write:SELECT *FROM animalListWHERE (animal LIKE '%cat%') OR (animal LIKE '%dog%')But is there any shorter way of writing this statement?regards |
|
|
Andraax
Aged Yak Warrior
790 Posts |
Posted - 2004-12-01 : 07:52:48
|
| Not really, if you want to use the LIKE operator. Otherwise you can do:SELECT *FROM animalListWHERE animal in ('cat', 'dog') |
 |
|
|
|
|
|