【发布时间】:2014-03-12 00:53:49
【问题描述】:
我有一个表,其中的 ID 列可以包含重复项,因为它用作与我的主表匹配的外键。每个 id 可以有多个结果,如下例所示:
ID FieldValue
1 This
2 Also this
1 and that
3 And additionally, this.
2 and, finally, this.
如何合并 FieldValue 列以使每个 ID 只有一行?例如
ID FieldValue
1 This;and that
2 Also this;and, finally, this.
3 And additionally, this.
如果必须保留重复的行,我不会担心,例如
ID FieldValue
1 This;and that
2 Also this;and, finally, this.
1 This;and that
3 And additionally, this.
2 Also this;and, finally, this.
因为我现在可以对它们运行 DISTINCT 查询,因为它们确实是重复的。谷歌搜索了一段时间没有结果;我怀疑是因为它有几个步骤,我需要知道这些步骤是什么,然后搜索才会有成果。
有什么想法吗?
【问题讨论】:
-
谢谢@GordThompson,已经解决了。我的措辞有误,但会在此处留下这个问题,以防其他人也措辞错误!
标签: sql ms-access concatenation ms-access-2010