【发布时间】:2014-06-19 15:38:09
【问题描述】:
我有一个表格查询
SELECT pub.id, topic.id, pub.title, etc...
FROM pub, topic, link
WHERE (matching logic)
以形式返回
pub.id | topic.id | pub.title
---------------------------------
x1 | a | y1
x1 | b | y1
x1 | ... | y1
x2 | c | y2
x2 | d | y2
x2 | ... | y2
我真正想要的是表单的响应
pub.id | topic.id | pub.title
---------------------------------
x1 | a, b ... | y1
x2 | c, d ... | y2
(我觉得匹配逻辑不重要,有需要我会贴出来的。)
我试过group_concat() 和coalesce,但没有任何效果。有什么帮助吗?
【问题讨论】:
-
你是如何尝试的
group_concat你能发布那个查询吗?
标签: mysql database coalesce sql-server-group-concat