我有查询哪个连接字符串,如果它们属于一个组.
SELECT e.id,ke.value,re.value AS re_value,GROUP_CONCAT(g.value,',') FROM entry e INNER JOIN k_ele ke ON e.id = ke.fk INNER JOIN r_ele re ON e.id = re.fk INNER JOIN sense s ON e.id = s.fk INNER JOIN gloss g ON s.id = g.fk WHERE g.lang IS NULL GROUP BY s.id ORDER BY re_value
但
GROUP_CONCAT(g.value,’,‘)
正在给出这个结果.
affectionate relationship,affectionate relationship,loving relationship,loving relationship
您可以看到连接中有重复.如何避免重复连接?
GROUP_CONCAT(DISTINCT g.value)