select 1


Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science

Q&A for scientists using computers to solve scientific problems

create table #t(pageno int, groupid varchar(10))
insert #t values (100100,  'mpadilla')
insert #t values (100101,  'Mine')

declare @a varchar(4000)

select @a = coalesce(@a + x, x)
(select top 100 percent
'[' +groupid + ']=MAX(CASE groupid WHEN ''' +groupid+ '''  THEN ''X'' ELSE ''--'' END)' x
from #t DistinctPages Group by groupid order by groupid) t

select @a

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results