从Entities.name中找是否包含'中国人民人寿保险股份有限公司'的字符串,如果有,则取剩下部分的值,如果没有则取Entities.name的值。
select urid,case when instr(Entities.name,'中国人民人寿保险股份有限公司') = 1 and length(entities.name) > 14 then substr(Entities.name,15) else Entities.name end name
from entities
如:InStr([start, ]string1, string2[, compare]) 返回指定一字符串在另一字符串中最先出现的位置。在字符串string1中,从start开始找string2,省略start时从string1头开始找。找不到时,函数值为0。 如果 string1 为零长度 InStr返回 0 string1 为 Null InStr返回 Null string2 为零长度 InStr返回 Start 的值 string2 为 Null InStr返回 Null string2 找不到 InStr返回 0 在 string1 中找到string2 InStr返回 找到的位置 start 值 > string2 值 InStr返回 0
select urid,case when instr(Entities.name,'中国人民人寿保险股份有限公司') = 1 and length(entities.name) > 14 then substr(Entities.name,15) else Entities.name end name
from entities
如:InStr([start, ]string1, string2[, compare]) 返回指定一字符串在另一字符串中最先出现的位置。在字符串string1中,从start开始找string2,省略start时从string1头开始找。找不到时,函数值为0。 如果 string1 为零长度 InStr返回 0 string1 为 Null InStr返回 Null string2 为零长度 InStr返回 Start 的值 string2 为 Null InStr返回 Null string2 找不到 InStr返回 0 在 string1 中找到string2 InStr返回 找到的位置 start 值 > string2 值 InStr返回 0