je le recordset suivant:Groupe enregistre et mettre les résultats dans le champ unique
ID AssetName
882 Training Room VCR
882 Training Room DVD
882 Training Room TV
858 Training Room VCR
858 Training Room Computer
858 Training Room TV
Je veux groupe chaque ID et obtenir un resultset en tant que tel:
ID Assets
882 Training Room VCR<br/>Training Room DVD<br/>Training Room TV
858 Training Room VCR<br/>Training Room Computer<br/>Training Room TV
Y at-il un moyen de construire une instruction SQL 2005 qui va le faire?
double question
How to return multiple values in one column (T-SQL)?
Cela donne les enregistrements dans ce format:
Ensuite, essayez ce SELECT DISTINCT [ID] , REPLACE (CONVERT (VARCHAR (MAX), (SELECT [assetname] + ' XXX ' FROM [dbo]. [NomTable] t1 OERE t1. [ID] = t. [ID] POUR CHEMIN XML (' ') )),' XXX ','
') [ressource] DE [ dbo]. [nomTable] t – Slim