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

相关文章:

  • 2021-12-12
  • 2021-11-10
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-10-03
  • 2021-11-11
相关资源
相似解决方案