我有一個字符串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
- 我在這裏的東西
什麼是定義的規則特定的子字符串? –