Dynamic SQL pp 327-360 | Cite as

Dynamic Pivot and Unpivot

  • Edward Pollack


PIVOT is an extremely efficient way to alter the structure of a result set, expanding a single column of values into a set of separate columns. UNPIVOT does the exact opposite, taking a set of columns and resolving them into a single output column. Both of these operators can be very useful in reporting, analytics, or when trying to format existing data into a specific structure as required by an application.

Copyright information

© Edward Pollack 2019

Authors and Affiliations

  • Edward Pollack
    • 1
  1. 1.AlbanyUSA

Personalised recommendations