我在MS Access 2007中有一个问题,我希望有人有答案.我有一个很长但很简单的表,其中包含客户名称以及交付周的日期.我想通过将名称和所有日期列入一个新字段"ALLDays",同时仍然保留所有数据来总结此表.
源表看起来像这样:
Name Day
CustomerA Monday
CustomerA Thursday
CustomerB Tuesday
CustomerB Friday
CustomerC Wednesday
CustomerC Saturday
Run Code Online (Sandbox Code Playgroud)
我想有一个返回如下结果的查询:
Name ALLDays
CustomerA Monday, Thursday
CustomerB Tuesday, Friday
CustomerC Wednesday, Saturday
Run Code Online (Sandbox Code Playgroud)
谢谢.
我有这样一张桌子:
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
Run Code Online (Sandbox Code Playgroud)
在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
Run Code Online (Sandbox Code Playgroud)
如何只用SQL(没有VBA /脚本)来完成?FOR …
可能的重复:
Ms Access 查询:通过查询连接行
我有一个包含很多列的表,但有两个感兴趣的列:订单号和产品类型。目前,该表每个订单有多个产品类型。如果客户订购了电话服务、电视服务和互联网服务,那么将有三条记录——每项服务一个,但都具有相同的订单号。我想创建一个参考表来存储一个包含客户订购的所有服务的串联字符串。这样我就可以使用这种更合乎逻辑的方法来总结我的数据。我正在使用标准的 Access 2010 数据库。
**Current table:**
Order Number | Product Types
100001 | TV
100001 | Phone
100001 | Internet
100002 | Phone
100003 | TV
100003 | Internet
Run Code Online (Sandbox Code Playgroud)
所需参考表
100001 | TV/Phone/Internet
100002 | Phone
100003 | TV/Internet
Run Code Online (Sandbox Code Playgroud)