Думаю, я понял. Это сложнее, чем я мог подумать, но я думаю, что это то, что вы хотите:
select t1.*, t2.category_spend
from table1 t1 join
(select t2.product, sum(t1.spend) as category_spend
from table1 t1 join
table2 t2
on t1.week between t2.weekstart between t2.weekend
group by t2.product
) t2w
on t2w.product = t1.product;
EDIT:
Основываясь на вашем комментарии, logi c в основном тот же . customer
не различается в вопросе, поэтому его можно просто включить «везде»:
select t1.*, t2.category_spend
from table1 t1 join
(select t1.customer, t2.product, sum(t1.spend) as category_spend
from table1 t1 join
table2 t2
on t1.week between t2.weekstart between t2.weekend
group by t2.product, t1.customer
) t2w
on t2w.product = t1.product and t2w.customer = t1.customer;