当前位置:Gxlcms > 数据库问题 > 【转】mysql用sql实现split函数

【转】mysql用sql实现split函数

时间:2021-07-01 10:21:17 帮助过:20人阅读

a.id , a.NAME , substring_index(substring_index(a.shareholder, ,, b.help_topic_id + 1), ,, - 1) AS shareholder FROM company a INNER JOIN mysql.help_topic b ON b.help_topic_id < (length(a.shareholder) - length(REPLACE(a.shareholder, ,, ‘‘)) + 1)


4、附录
基本表建立语句

CREATE TABLE `company` (
`id` int(20) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`shareholder` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `company` VALUES (1, 阿里巴巴, 马云);
INSERT INTO `company` VALUES (2, 淘宝, 马云,孙正义);


原文:https://blog.csdn.net/WY18334783911/article/details/83379450

【转】mysql用sql实现split函数

标签:tps   mic   arch   div   淘宝   any   engine   company   sub   

人气教程排行