1. 先看下构建好的关系图谱如下:
2. 构建节点,并且导入数据
create table ch_from_to_count(
id int primary key auto_increment,
fromWho VARCHAR(100),
toWho varchar(100),
caseId VARCHAR(24),
countNum int(11)
)charset utf8;
表中插入数据:
insert into ch_from_to_count(fromWho,toWho,caseId,countNum)
SELECT * from(
SELECT DISTINCT fromWho,substring_index(substring_index(t.toWho,';', b.help_topic_id + 1), ';', -1) toWho ,caseId,countNum
FROM (
SELECT DISTINCT * from from_to_count_2
) t
join mysql.help_topic b
ON b.help_topic_id < (LENGTH(t.toWho) - LENG