//一个很笨的方法,且没验证。
...
declare @ilen int,@it int,@ic int
declare @ct char(1),@st varchar(255)
declare
select @ilen=len(@str),@it=1,@ic=0
while (@ic<@ilen)
begin
select @ic=@ic+1
select @ct=substring(@str,@ic,1)
if (@ct=',')
begin
select @st=substring(@str,@it,@ic-@it)
......(其它处理)
select @it=@ic
end
end
select @st=substring(@str,@it,@ilen-@it)
if @st<>''
begin
......(其它处理)
end
...
...
declare @ilen int,@it int,@ic int
declare @ct char(1),@st varchar(255)
declare
select @ilen=len(@str),@it=1,@ic=0
while (@ic<@ilen)
begin
select @ic=@ic+1
select @ct=substring(@str,@ic,1)
if (@ct=',')
begin
select @st=substring(@str,@it,@ic-@it)
......(其它处理)
select @it=@ic
end
end
select @st=substring(@str,@it,@ilen-@it)
if @st<>''
begin
......(其它处理)
end
...
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货