

Here’s an example of using the UNPIVOT operator to convert repeating columns of a table, into a more normalized form

Note: PIVOT and UNPIVOT operators are available in SQL Server 2005 and onwards. The UNPIVOT operator performs the reverse operation of PIVOT, by rotating columns into rows.

The PIVOT operator allows you to rotate, or pivot, data between columns and rows, and performs aggregations where they are required on any remaining column values.
