Home Forums SQL Server 2005 Development Need to merge multiple rows into one with carriage return RE: Need to merge multiple rows into one with carriage return
_DJ
Valued Member
Points: 67
More actions
November 9, 2010 at 2:59 am
#1248095
try like this
SELECT
ID,
[Description] = MAX(o.list)
FROM
@Sample T1
CROSS APPLY
(
SELECT ISNULL([Description], '') AS [data()]
FROM @Sample T2
WHERE T2.ID = T1.ID
FOR XML PATH ('')
)o(list)
GROUP BY ID