If you know that SeqNo will never be more than 3:
select Id, Names = stuff( max(case when SeqNo = 1 then '/'+Name else '' end) + max(case when SeqNo = 2 then '/'+Name else '' end) + max(case when SeqNo = 3 then '/'+Name else '' end) , 1, 1, '') from table1 group by Id
Otherwise, something like this is a general solution for an arbitrary number of elements:
select Id, Names = stuff(( select '/'+Name from table1 b where a.Id = b.Id order by SeqNo for xml path ('')) , 1, 1, '') from table1 a group by Id
Or write UR CLR.
Edit: had the wrong alias in the correlated table!
Edit2: another version based on Remus recursion example. I could not think of any way to select only the last recursion on Id without aggregation or sorting. Somebody knows?
;with myTable as ( select * from ( values (1, 1, 'RecordA') , (2, 1, 'RecordB') , (3, 1, 'RecordC') , (1, 2, 'RecordD') , (4, 1, 'RecordE') , (5, 1, 'RecordF') , (3, 2, 'RecordG') ) a (Id, SeqNo, Name) ) , anchor as ( select id, name = convert(varchar(max),name), seqno from myTable where seqno=1 ) , recursive as ( select id, name, seqno from anchor union all select t.id, r.name + '/' + t.name, t.seqno from myTable t join recursive r on t.id = r.id and r.seqno+1 = t.seqno ) select id, name = max(name) from recursive group by id;