首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Access >

access合拢多行列数据到一行,类似于mysql的group_concact()函数

2012-07-16 
access合并多行列数据到一行,类似于mysql的group_concact()函数(Q)??? I need to concatenate a field in

access合并多行列数据到一行,类似于mysql的group_concact()函数

access合拢多行列数据到一行,类似于mysql的group_concact()函数

(Q)??? I need to concatenate a field in the format "Value1; Value2;Value3" etc. for each unique value of another field in the same table.? How canI do this?

(A)??? Using the fConcatFld function,? in the Northwind database,the following query should return a concatenated list of all CustomerIDs if you group byContactTitle.

使用方式:
SELECT ContactTitle,fConcatFld("Customers","ContactTitle","CustomerID","string",[ContactTitle])AS Customers FROM Customers GROUP BY ContactTitle;

?

参数说明:

fConcatFld参数说明stTable As String 表名称?_stForFld As String,  查询的条件字段名称_stFldToConcat As String,  合并的字段名称_ stForFldType As String, 合并字段的类型_vForFldVal As Variant 合并字段的查询条件
'************ Code End **********

热点排行