Monday, September 30, 2013

merging multiple rows to a single row


declare @t table(col varchar(10));
insert into @t values('Ab'),('cd'),('ef');
select * from @t

select distinct stuff((select '' + col
FROM @t FOR XML PATH('')), 1, 0, '' ) as col





ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you



No comments:

Post a Comment