0 function:
CHARINDEX ( expression1 , expression2 [ , start_location ] )
Get the position of the first occurrence of a character
Parse:
expression1 required --- substring to find
expression2 required --- parent string
start_location optional --- specify the location to search from the parent string, the default location starts from 1
1 function:
REVERSE(express)
Sort string from tail to head
2 functions:
Gets the substring, starting at position <pos> in <str> and selecting the next <len> characters.
3 Combining functions:
Get the position of the last occurrence of the character "." in the string 1.2.3.4
len('1.2.3.4')-CHARINDEX('.',REVERSE('1.2.3.4'))+1
4 Combining functions:
Truncate the substring before the last decimal point
SUBSTRING('1.2.3.4',1,len('1.2.3.4')- CHARINDEX('.',REVERSE('1.2.3.4')))
The result is as follows: