Concatenación en SQL Server.

SELECT * FROM [Catalogos].[CategoriasGasto];

SELECT 
	STUFF(
			CAST((SELECT
					CONCAT(',',MAX(Descripcion)) 
				FROM 
					[Catalogos].[CategoriasGasto]					
				GROUP BY 
					Descripcion
				FOR XML PATH('')) AS VARCHAR(8000))
			,1
			,1
			,''
		) AS 'Concatenacion';

Agregar comentario

Loading