截取第二个','与第三个','之间的数据
declare @str nvarchar(50);
set @str=',1,6,7,8,';
select LEFT(SUBSTRING(@str,charindex(',',@str,2)+1,len(@str)),CHARINDEX(',',SUBSTRING(@str,charindex(',',@str,2)+1,len(@str)),1)-1) as '中间的值'
截取第二个','与第三个','之间的数据
declare @str nvarchar(50);
set @str=',1,6,7,8,';
select LEFT(SUBSTRING(@str,charindex(',',@str,2)+1,len(@str)),CHARINDEX(',',SUBSTRING(@str,charindex(',',@str,2)+1,len(@str)),1)-1) as '中间的值'