The Pivot function pivots data that is stored in rows into columns. It outputs a table whose columns are based on the individual values from an input table column. The schema of the output table depends on the arguments to the function. The function handles missing or NULL values automatically.
The reverse of this function is Unpivot.