sqlite – 如何避免在GROUP_CONCAT中重复?

前端之家收集整理的这篇文章主要介绍了sqlite – 如何避免在GROUP_CONCAT中重复?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有查询哪个连接字符串,如果它们属于一个组.
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)

猜你在找的Sqlite相关文章