Coba ini:
select
workweek
,(select sum(cost) from DataTable where Catg = 'Cat1') as Cat1TotalCost
,(select sum(cost) from DataTable where Catg = 'Cat2') as Cat2TotalCost
,(select sum(cost) from DataTable where Catg = 'Cat3') as Cat3TotalCost
.
.
.
.
from DataTable
group by Workweek
Sekarang, Anda mengelompokkan berdasarkan bidang minggu kerja. Juga, saya mengubah like
ke =
untuk membuatnya sedikit lebih cepat.