From: Plamen Ratchev on
Another example is using the PIVOT operator. If you write a query like this:

SELECT <columns>
FROM Table
PIVOT (SUM(col1) FOR col2 IN (...)) AS P;

In this case the PIVOT operator will add grouping by all columns from Table that are not used as arguments for PIVOT
(col1, col2).

Using derived table this can be avoided and you can select only the needed grouping column(s):

SELECT <columns>
FROM (SELECT col1, col2, group_column FROM Table) AS T
PIVOT (SUM(col1) FOR col2 IN (...)) AS P;

--
Plamen Ratchev
http://www.SQLStudio.com