SELECT year
,SUM (
	CASE WHEN quarter = 'Q1' 
	THEN amount ELSE 0 END) Q1
,SUM (
	CASE WHEN quarter = 'Q2' 
	THEN amount ELSE 0 END) Q2
,SUM (
	CASE WHEN quarter = 'Q3' 
	THEN amount ELSE 0 END) Q3
,sum (
	CASE WHEN quarter = 'Q4' 
	THEN amount ELSE 0 END) Q4
FROM
SalesByQuarter
	GROUP BY year
	ORDER BY year DESC
a
b
c
