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 |
|
Einar
Starting Member
2 Posts |
Posted - 2008-01-09 : 13:29:12
|
| Hi. hope someone can help me with this thing.I have a list of numbers that I get from a query to my database. how could I make the query so that I can exclude a couple of numbers. For example the numbers 1234 and 8888. My list is in the range of 1 - 99999. Thank youMr. Newbie |
|
|
stowellg
Starting Member
9 Posts |
Posted - 2008-01-09 : 13:34:16
|
| I'll get crucified for this, but--assumes its a number datatype of some sortSELECT theNumberFrom theTableWhere theNumber not in (1234,8888)--If its a range of numbers--lists all numbers but those in the range of 1234 and 8888--so 1-1233 shows up, and 8889-9999 shows upSELECT theNumberFrom theTableWhere theNumber not between 1234 and 8888Just a warning to beware not in, and large lists of values.I have a stupid question for you... |
 |
|
|
|
|
|