Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Capovolgi risultato SQL

Puoi usare il pivot

select [1],[2],[3],[4],[5]
from
(
  select column1, column2
  from mytable
) d
pivot
(
  max(column2)
  for column1 in ([1],[2],[3],[4],[5])
) piv;

DEMO SQL FIDDLE