if object_id('[aaa]') is not null drop table [aaa] go create table [aaa]([地區] varchar(4),[內容] varchar(45)) insert [aaa] select '中國','021sp.html|管材|4355;028sp.html|建築材料|3209' union all select '中國','023sp.html|材|4356;025sp.html|建|9209' go -->開始查詢 select a.地區, 內容=substring(a.內容,b.number,charindex(';',a.內容+';',b.number)-b.number) from [tb] a join master..spt_values b on b.type='P' where substring(';'+a.內容,b.number,1)=';' -->測試結果 ---- -------------------------- /* 地區 內容 中國 021sp.html|管材|4355 中國 028sp.html|建築材料|3209 中國 023sp.html|材|4356 中國 025sp.html|建|9209