PIVOT clause can be used to pivot
columns, “rotating” column values into multiple columns (one for each value),
creating wider and shorter denormalized tables from longer, more normalized
tables.
PIVOT Syntax
phone_number, which lists each phone number
for a customer as a separate record in the table, a pivot operation can be
performed, creating a single record per customer with the home, work, & cell
phone numbers as separate columns.
With this data:
Input
PIVOT Example
Output