自学内容网 自学内容网

mysql表列中字符串逗号分割转列

create table temp_1 as 
SELECT a.appid
    , a.`NAME`
    , substring_index(substring_index(a.`NAME`, ',', b.help_topic_id + 1), ',', - 1) AS xinming
FROM temp a
INNER JOIN mysql.help_topic b
    ON b.help_topic_id < (length(a.`NAME`) - length(REPLACE(a.`NAME`, ',', '')) + 1);
 


原文地址:https://blog.csdn.net/jspamd/article/details/137154865

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!