Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql server pivot rows to columns

select Firstname, Amount, PostalCode, LastName, AccountNumber
from
(
  select value, columnname
  from yourtable
) d
pivot
(
  max(value)
  for columnname in (Firstname, Amount, PostalCode, LastName, AccountNumber)
) piv;
 
PREVIOUS NEXT
Tagged: #sql #server #pivot #rows #columns
ADD COMMENT
Topic
Name
4+7 =