需求:实际项目中需要截取第2到第3个逗号中间部分的内容 方案: declare @str nvarchar(50);set @str='11,222,3333,44444';select @str as '字符串'select len(@str) as '字符长度'select charindex(',',@str,1) as '第一个逗号的索引值'select LEFT(@str,charindex(',',@str,1)-1) as '第一个值'select SUBSTRING(@str,c