Loading

sql server分组逗号隔开字段

   

 

select
SUBSTRING(a.RetRCode,number,CHARINDEX(',',a.RetRCode+',',number)-number) as name
from
InRetMatAppH a,master..spt_values
where
number >=1 and number<len(a.RetRCode)
and type='p'
and substring(','+a.RetRCode,number,1)=','

 

posted @ 2017-11-03 09:10  百_晓生  阅读(1086)  评论(0编辑  收藏  举报