可變長度的拉拔字符串請參閱下面的DDL:與自由文本
create table #Test (comments varchar(1000))
insert into #Test values ('Nominal linking: NOMINAL_ID 9 has been established to be the same person as NOMINAL_ID 1 and the nominals have been linked.')
insert into #Test values ('Nominal linking: NOMINAL_ID 12 has been established to be the same person as NOMINAL_ID 641 and the nominals have been linked.')
insert into #Test values ('Nominal linking: NOMINAL_ID 123 has been established to be the same person as NOMINAL_ID 2019 and the nominals have been linked.')
insert into #Test values ('Nominal linking: NOMINAL_ID 1234 has been established to be the same person as NOMINAL_ID 22222 and the nominals have been linked.')
insert into #Test values ('Nominal linking: NOMINAL_ID 12345 has been established to be the same person as NOMINAL_ID 22 and the nominals have been linked.')
我試圖返回在SQL查詢以下,不相信這是可以做到:
MasterID ChildID
9 1
12 641
123 2019
1234 22222
12345 22
我意識到這張表的設計很差。它是一個外部開發的系統。
你應該可以用PatIndex和SubString來完成它。 – 2015-03-02 17:20:00