Vision Binary

work hard, be nice, amazing things will happen


MS SQL Server

  • ways to transpose data in a SQL table from row-columns to column-rows?

    from http://stackoverflow.com/questions/14066927/what-are-some-good-ways-to-transpose-data-in-a-sql-table-from-row-columns-to-col If you are using SQL Server 2005+, then you have a few options to transpose the data. Existing table has following Columns: AID (nvarchar unique) ASID (nvarchar unique) Milestone (M1, M2, M3…M100) MilestoneDate (datetime) Transposed data as follows: AID, ASID, M1 Date, M2 Date, M3 Date, M5 Date You can implement the PIVOT… Continue reading