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 |
|
tech1
Starting Member
49 Posts |
Posted - 2010-06-23 : 13:24:03
|
| this is an odd one.i have a table where a field contains audits of downloads from a siteQueryType is a parameter the SPROC will be getting but here ishow the field values look typically (from resources/....)QueryType 1: resources/downloads/staticQueryType 2: resources/downloads/static/loyaltyQueryType 3: resources/downloads/{A NUMBER HERE}how can I only perform a select where QueryType1 will only get back records that do not contain anything AFTER /loyalty, as this is only for querytype2?what about getting records where QueryType3 is given and will only get me numbers after the downloads/ and NOT /static or static/loyalty - so its just numbers?any ideas? |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-06-23 : 18:42:57
|
1WHERE MyColumn = 'resources/downloads/static/loyalty'or perhapsWHERE MyColumn LIKE '%/loyalty'2WHERE MyColumn LIKE 'resources/downloads/%' AND MyColumn NOT LIKE 'resources/downloads/%[^0-9]%' I have presumed that "{A NUMBER HERE}" comprises only digits - no ".", no "+" or "-" or any other character. |
 |
|
|
|
|
|