我有一个字符串com.test.edu.personal.SomeException: this is some error: test message
。我需要得到字符串为SomeException: this is some error
。如何获得SQL Server中某些字符之间的子串
我有我的代码的烦恼:
declare @col varchar(100)
set @col = 'com.test.edu.personal.SomeException: this is some error: test message'
SELECT
SUBSTRING(@col,
LEN(@col) - CHARINDEX(':', @col) - CHARINDEX(':', REVERSE(@col)),
LEN(@col) - LEN(LEFT(@col, CHARINDEX ('.', @col))) - LEN(RIGHT(@col, LEN(@col) - CHARINDEX (':', @col))));
我越来越nal.SomeException: this is some
- 我在这里的东西
什么是定义的规则特定的子字符串? –