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 |
|
HoodRat
Starting Member
1 Post |
Posted - 2006-06-08 : 13:15:51
|
| I am trying to figure out how to locate a specific set of data, in a field, delimited with commas. ex "987654,654987,123456"I want to write a query that will locate the entry that has 654987, and update that cell with "987654,123456" thus deleting the middle entry.Any ideas? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-06-08 : 13:46:54
|
| [code]UPDATE Table1SET Field1 = LEFT(REPLACE(Field1 + ',', '654987' + ',', ','), LEN(Field1))WHERE CHARINDEX('654987' + ',', Field1 + ',') > 0[/code] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|