FOR XML

Wikis > SQL Wiki > FOR XML
SELECT [Key]                                                                     AS [Key],
       Left((SELECT CONVERT(varchar(50), [ID]) + ','
             FROM [_META].[_addresses].[DetailKeys]
             WHERE [Key] = dk.[Key]
             FOR XML PATH('')), LEN((SELECT CONVERT(varchar(50), [ID]) + ','
                                     FROM [_META].[_addresses].[DetailKeys]
                                     WHERE [Key] = dk.[Key]
                                     FOR XML PATH(''))) - 1)                     AS [IDs]
FROM [_META].[_addresses].[DetailKeys] dk
GROUP BY [Key]
Category: Tags:
Von |2015-06-13T22:53:34+00:00Juni 10th, 2015|Kommentare deaktiviert für FOR XML

About the Author:

Frank Uray