Step2:根据“,”逗号来拆分字符串,此处利用 SUBSTRING_INDEX(str, delim, count) 函数,最后把结果赋值给 num 字段。...SELECT SUBSTRING_INDEX('7654,7698,7782,7788',',',2);
(2)获取最后一个到倒数第2个以逗号分隔符之后的所有字符
SELECT SUBSTRING_INDEX...涉及的代码片段:
SUBSTRING_INDEX(SUBSTRING_INDEX('7654,7698,7782,7788',',',help_topic_id+1),',',-1) AS num
第一步...SUBSTRING_INDEX(SUBSTRING_INDEX('7654,7698,7782,7788',',',help_topic_id+1),',',-1)
eg:
根据第一步,当 help_topic_id...(
ids,
LENGTH(
CONCAT(
substring_index( ids, ',', 1 ),
SUBSTR( substring_index( ids, ',', 2