a
b
SELECT year
,SUM (
	CASE WHEN quarter = 'Q1' 
	THEN amount ELSE 0 END) Q1
,SUM 
…
FROM
SalesByQuarter
	GROUP BY year
	ORDER BY year DESC
SELECT * FROM SalesByQuarter
PIVOT
(
SUM (amount)
FOR quarter IN (Q1, Q2, Q3, Q4)) AS P
ORDER BY YEAR DESC
