PIVOT single row table and 10 columns

0

I am trying to transpose a table of a row with 10 columns and I use this but I get an error in the code:

SELECT descripcion
    ,Check01
    ,Check02
    ,Check03
    ,Check04
    ,Check05
    ,Check06
    ,Check07
    ,Check08
    ,Check09
    ,Check10
    ,
FROM (
    SELECT *
    FROM tabla_resultado_checks
    WHERE descripcion = 'Resultado'
    ) AS tabla_inicial
pivot(Descripcion FOR Descripcion IN (
            Check01
            ,Check02
            ,Check03
            ,Check04
            ,Check05
            ,Check06
            ,Check07
            ,Check08
            ,Check09
            ,Check10
    ) AS pivot_table)

The error I'm getting is the following:

  

Incorrect syntax near the keyword 'for'.

I do not know if I'm doing the pivot right or wrong

    
asked by anasavilu 22.05.2017 в 12:51
source

0 answers