mysql分号分割开字段。拆分

问题-: MySQL如何进行以,分割的字符串的拆分
分割开逗号 分号的字段。其他字段自动补齐。

成都创新互联主营信丰网站建设的网络公司,主营网站建设方案,App定制开发,信丰h5成都微信小程序搭建,信丰网站营销推广欢迎信丰等地区企业咨询

https://blog.csdn.net/u012009613/article/details/52770567


 SELECT s.* from (
SELECT t.ID,t.time_old,
    substring_index( substring_index( t.all_content, ';', b.help_topic_id + 1 ), ';', -1 ) content_split
-- t.* 
FROM
    excel_lvli t
    JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( t.all_content ) - LENGTH( REPLACE ( t.all_content, ';', '' ) ) + 1 )
and t.all_content like '%;%'
and t.all_content like '%画了许多%' 
) s 
WHERE  LENGTH(s.content_split) >0 ;

SELECT
    substring_index( substring_index( t.context, ',', b.help_topic_id + 1 ), ',', - 1 ) 
FROM
    test.test t
    JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( t.context ) - LENGTH( REPLACE ( t.context, ',', '' ) ) + 1 );

实现出来的效果。 :

mysql分号分割开字段。拆分


本文名称:mysql分号分割开字段。拆分
链接地址:http://hxwzsj.com/article/pdspjh.html

其他资讯

Copyright © 2025 青羊区翔捷宏鑫字牌设计制作工作室(个体工商户) All Rights Reserved 蜀ICP备2025123194号-14
友情链接: 重庆企业网站建设 梓潼网站设计 企业网站建设 成都网站制作公司 高端网站设计 成都网站建设 定制网站建设 成都网站建设 成都网站建设 手机网站建设套餐 定制网站制作 营销型网站建设 成都网站建设 网站制作报价 网站制作公司 成都网站制作 网站建设推广 重庆手机网站建设 app网站建设 四川成都网站设计 成都网站制作 成都网站制作