-- mysql 利用逗号拆分行,逗号拼接行 SELECT bh rkjsbh, xm rkjsxm, substring_index( substring_index( a.skxk, ',', b.help_topic_id + 1 ), ',',- 1 ) AS kcmc FROM yh a JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.skxk ) - length( REPLACE ( a.skxk, ',', '' )) + 1 ) WHERE zzjg_bh = 131 AND skxk != "" GROUP BY bh, xm, substring_index( substring_index( a.skxk, ',', b.help_topic_id + 1 ), ',',- 1 );
标签:substring,help,逗号,拼接,mysql,skxk From: https://www.cnblogs.com/hry99/p/16968045.html