O'Reilly logo
  • Dustin Waybright thinks this is interesting:

The grouping element is identified by elimination—it’s what’s left from the queried table besides the aggregation and spreading elements. This is why it is recommended to prepare a table expression for the pivot operator returning only the three elements that should be involved in the pivoting task. If you query the underlying table directly (Sales.Orders in this case), all columns from the table besides the aggregation (freight) and spreading (shipperid) columns will implicitly become your grouping elements.


Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012


They would be implicit, so not appearing. But, if custid had 15 orderid associated, it would be grouped 15 times not once.