Then you specify the IN clause followed by the list of distinct values that appear in the spreading element, separated by commas. What used to be values in the spreading column (in this, case shipper IDs) become column names in the result table. Therefore, the items in the list should be expressed as column identifiers. Remember that if a column identifier is irregular, it has to be delimited. Because shipper IDs are integers, they have to be delimited: ,,.
- 5. Grouping and Windowing
- from Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012
- Publisher: Microsoft Press
- Released: December 2012
Instead of automatically spreading the values in the spreading element, they must be listed in after the PIVOT operator and IN clause.
Share this highlighthttp://www.safaribooksonline.com/a/training-kit-exam/60658/