substring_index(input,split,index):input為要擷取的字元,split為分隔符,Index為要擷取第index個分隔符左(index為正)或右(index為負)的字串。
舉例:
"Provider="RiskManagement" finalScore="65" RGID="100397278"" //獲取finalScore的值
1、獲取finalScore右邊的字元
select substring_index("Provider="RiskManagement" finalScore="65" RGID="100397278"","finalScore="",-1);
2、再獲取" RGID="左邊的字元
select substring_index(substring_index("Provider="RiskManagement" finalScore="65" RGID="100397278"","finalScore="",-1),"" RGID="",1)。
substring_index(input,split,index):input為要擷取的字元,split為分隔符,Index為要擷取第index個分隔符左(index為正)或右(index為負)的字串。
舉例:
"Provider="RiskManagement" finalScore="65" RGID="100397278"" //獲取finalScore的值
1、獲取finalScore右邊的字元
select substring_index("Provider="RiskManagement" finalScore="65" RGID="100397278"","finalScore="",-1);
2、再獲取" RGID="左邊的字元
select substring_index(substring_index("Provider="RiskManagement" finalScore="65" RGID="100397278"","finalScore="",-1),"" RGID="",1)。