我遇到的问题是从中删除部分数据。
我下面有测试用例,有两个不同的列数据,一个包含要删除的单个条目,第二个包含要删除的多个条目。
Adjusted By Abbr Malkum on 02/06/2014 5:10:12 PM Session 1 Time-In changed from 9:14 AM to 9:16 AM Session 1 Time-Out changed from 9:15 AM to "Not Set" with Notes: Forgot to clock out, Automatically adjusted.
Adjusted By Abbr Malkum on 02/06/2014 5:07:27 PM Session 1 Time-In changed from 10:48 AM to 10:50 AM Adjusted By Abbr Malkum on 02/06/2014 5:07:34 PM Session 1 Time-In changed from 10:50 AM to "Not Set"
我想从给定数据中删除动态字符串。即
"Adjusted By Abbr Malkum on 02/06/2014 5:10:12 PM "
从第一行开始,从 Adju ... 开始直到会话文字开始
任何人都可以帮忙吗? 我不是SQL服务器的专家,但我确信必须找到一些索引,然后替换
答案 0 :(得分:1)
您正在寻找的功能是CHARINDEX,或PATINDEX,LEFT,SUBSTRING和REPLACE。第一个是:http://technet.microsoft.com/en-us/library/ms186323.aspx