litian
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

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-07-19
  • 2022-02-14
  • 2022-12-23
  • 2021-07-30
相关资源
相似解决方案