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 |
|
csphard
Posting Yak Master
113 Posts |
Posted - 2002-07-30 : 13:20:55
|
| the following statement does not error off but it does not give methe appropriate results. I know there is data because if i input '09%' i will get the correct data. How do i get 01,03 and 04data is 123456010000011235092222032222this is the sequel statementselect empid from due_evals WHERE empid LIKE '[01%,03%,09%]'whats wrong |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-30 : 13:23:42
|
| You'd need to do:select empid from due_evals WHERE empid LIKE '01%' OR empid LIKE '03%' OR empid LIKE '09%'Or (sorry, just thought of this):select empid from due_evals WHERE empid LIKE '0[139]%'Edited by - robvolk on 07/30/2002 13:24:27 |
 |
|
|
csphard
Posting Yak Master
113 Posts |
Posted - 2002-07-30 : 13:27:30
|
| I saw this example LIKE '[a-cdf]' a, b, c, d, or f but did not understand how that would work with out commas separatingthem for instance LIKE '[a-c,d,f]' |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-30 : 13:38:13
|
| Look in Books Online for more details on Like, there are several examples on how pattern matching works. |
 |
|
|
|
|
|