Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Transpose rows to columns - not a crosstab

    Another solution to the aforementioned problem:

    select distinct cID into #temptable from yourTable

    declare @var1 varchar(1000)

    set @var1='SELECT vID'

    select @var1=@var1+',MAX((Case WHEN cID='+quotename(cID,'''')+' THEN [value] ELSE null END)) AS ['+cID+'] ' from #temptable

    exec (@var1+'...

Viewing post 1 (of 1 total)