1. Use Substring_index (Src,target,index) to find the index target from the beginning of SRC. The returned substring is the string from the beginning of the SRC to the num target. Likesubstring_index (' ABSSCDESSFSS ', ' SS ', 1) return ABsubstring_index (' ABSSCDESSFSS ', ' SS ', 2) return ABSSCDEsubstring_index (' ABSSCDESSFSS ', ' TT ', 1) return ABSSCDESSFSSTherefore, check whether the string contains substrings, use Substring_index (' ABSSCDESSFSS ', ' TT ', 1) to see if he returns a substring, is a substring of the description contained, returns the original completed string, the description does not contain. Length (src)-Length (Substring_index (src,target,1)) >0 description contains. 2, the second method, the target is replaced with an empty string, if there is a target, the replacement length must be less than the original lengthLength (src)-Length (replace (Src,target, ')) >0 description contains. further thinking, you can also calculate the length of the string containing several substrings, divided by the length of the target, that is, the number of substrings. Select (Length (src)-Length (replace (Src,target, ')))/length (target);
MySQL checks if a string contains substrings