I have data like this I just want convert the rows into column
below Data
DECLARE @Table1 TABLE
( id int, name varchar(20), val varchar(20))
;
INSERT INTO @Table1
( id , name , val )
VALUES
(222, 'ram', 'match'),
(222, 'ra', 'nomatch'),
(222, 'man', 'nomatch'),
(222, 'kim', 'match')
;
I need output like this
ID Match NoMatch
222 ram,kim ra,man
Actually I have tried Pivot and Max Condition some where I'm missing Point .