2013-03-25 34 views
6

我有這樣的一個表:串連記錄和GROUP BY在Access

title    part     desc 
Blah This   1      This begins the 
Blah This   2      example table. 
Some Record   1      Hello 
Another    1      This text extends a bit 
Another    2      further so it is in 
Another    3      another record in the 
Another    4      table 

在Access中,我希望建立一個查詢/ SQL中GROUP BY title並連接所有的desc領域,所以它看起來像這樣:

title    desc 
Blah This   This begins the example table. 
Some Record  Hello 
Another   This text extends a bit further so it is in another record in the table 

這怎麼能用SQL(沒有VBA /腳本)完成? FOR XML PATH似乎不適用於Access,只有SQL Server。我在這裏嘗試過VBA How to improve efficiency of this query & VBA?,但它實在太慢了。

還是有一個函數可以使用,而不是連續運行,而查詢已經打開?

+0

看看這個。不知道如果FOR XML PATH在Access中工作,但如果它的確如此,這是你的答案:http://stackoverflow.com/questions/14082863/concatenation-of-strings-by-for-xml-path – 2013-03-25 21:20:52

+1

有沒有辦法在Access中只使用Sql來做到這一點。 [你需要使用一個函數](http://wiki.lessthandot.com/index.php/Concatenate_a_List_into_a_Single_Field_%28Column%29)。 – 2013-03-25 21:25:36

回答