赞
踩
根据逗号分割
- select
- "其余字段",
- SUBSTRING(a.要分隔字段,number,CHARINDEX(',',a.要分隔字段+',',number)-number) as company
- from 目标表a,master..spt_values
- where number >=1
- and number < len(要分隔字段)
- and type='p'
- and SUBSTRING(','+要分隔字段,number,1)=','
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。