I have a SQL Server table with columns primary key (int), date (datetime), amount (int).
How can I create a pivot table like this?

I have a SQL Server table with columns primary key (int), date (datetime), amount (int).
How can I create a pivot table like this?

Are you looking for grouping sets?
select year(date), datepart(quarter, date), sum(amount)
from t
group by grouping sets ( (year(date), datepart(quarter, date)), (year(date)), () );