日期:2014-05-17 浏览次数:20506 次
declare @a varchar(100)
set @a='1,2,3,4'
select
v,
SUBSTRING(t.v, number ,CHARINDEX(',',t.v+',',number)-number)
from
(
select @a v
)t,master..spt_values s
where s.number >=1
and s.type = 'P'
and SUBSTRING(','+t.v,s.number,1) = ','