0 函数:
CHARINDEX ( expression1 , expression2 [ , start_location ] )
获取某字符第一次出现的位置
解析:
expression1 必需 ---要查找的子字符串
expression2 必需 ---父字符串
start_location 可选 ---指定从父字符串开始查找的位置,默认位置从1开始
1 函数:
REVERSE(express)
将字符串从尾部到头部排序
2 函数:
SUBSTR (str, pos, len)
获取子字符串,由 <str> 中的第 <pos> 位置开始,选出接下去的 <len> 个字元。
3 组合函数:
获取字符串1.2.3.4中字符"."最后一次出现的位置
len('1.2.3.4')-CHARINDEX('.',REVERSE('1.2.3.4'))+1
4 组合函数:
截取最后一个小数点前面的子字符串
SUBSTRING('1.2.3.4',1,len('1.2.3.4')- CHARINDEX('.',REVERSE('1.2.3.4')))
结果如下: