Step2:根据“,”逗号来拆分字符串,此处利用 SUBSTRING_INDEX(str, delim, count) 函数,最后把结果赋值给 num 字段。...from_str, to_str)
参数名 解释
str 需要进行替换的字符串
from_str 需要被替换的字符串
to_str 需要替换的字符串
举例
将分隔符逗号替换为空...库的 help_topic 表的 help_topic_id 来作为变量,因为 help_topic_id 是自增的,当然也可以用其他表的自增字段辅助。...,此处利用 SUBSTRING_INDEX(str, delim, count) 函数,最后把结果赋值给 num 字段。...SUBSTR( substring_index( ids, ',', 2 ), LOCATE( ',', substring_index( ids, ',', 2 ), 1 )+ 1 ) id2,
-- 将第一个字符串和第二个字符串的长度