呼如林
您可以连接报告源中的值。SQL 示例:WITHla_service_provider_serviceAS( SELECT tbl.* FROM (VALUES ( 1, '1@gmail.com') , ( 1, '2@gmail.com') , ( 1, '3@gmail.com') , ( 2, '4@gmail.com') , ( 2, '5@gmail.com') , ( 2, '6@gmail.com') , ( 2, '7@gmail.com') ) tbl ([LA_SERVICE_PROVIDER_ID], [PROVIDER_EMAIL]) )SELECT [lasps].[LA_SERVICE_PROVIDER_ID] , [lasps].[PROVIDER_EMAIL] , [ALL_PROVIDER_EMAILS] = STUFF( (SELECT '; '+ [PROVIDER_EMAIL] FROM [la_service_provider_service] AS [lasps2] WHERE [lasps2].[LA_SERVICE_PROVIDER_ID] = [lasps].[LA_SERVICE_PROVIDER_ID] FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(2000)') ,1,2,'')FROM [la_service_provider_service] AS [lasps];结果: