标签:index string 字符 substr 输出 arch arc varchar select
DECLARE @str AS VARCHAR(25)=‘123_234_567‘
select substring(@str,1,LEN(@str)-CHARINDEX(‘_‘,reverse(@str)))
输出 123_234
DECLARE @str AS VARCHAR(25)=‘123_234_567‘
select reverse(substring(reverse(@str),1,charindex(‘_‘,reverse(@str)) - 1))
输出567
标签:index string 字符 substr 输出 arch arc varchar select
原文地址:http://www.cnblogs.com/damsoft/p/6089779.html