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 |
|
daniel50096230
Yak Posting Veteran
99 Posts |
Posted - 2011-04-05 : 04:45:21
|
| Hi,I have an id something like 'TEFS_10-1-1'How should I write my sql so that it will match the id with those number after "_" in above id? I know I can use substring, but the problem is the character before "_" is not fix.Eg.ON T.Reference_ID = A.Reference_ID Where A.Reference_ID is '10-1-1' but not 'TEFS_10-1-1'. So how can I filter out those character before "_" |
|
|
matty
Posting Yak Master
161 Posts |
Posted - 2011-04-05 : 05:06:27
|
| SELECT SUBSTRING(Reference_ID ,CHARINDEX('_',Reference_ID ) + 1,LEN(Reference_ID )) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-04-05 : 07:39:09
|
| orselect parsename(replace(col,'_','.'),1) from tableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|