I had a piece of code running that is fundamentally the same as the below except it uses temporary tables instead of nested queries. Is there something wrong with what I am trying to do? The one with temp tables works fine...
select category_a, category_b, count(customer_name) as instances, sum(spend) as spend
select f.customer_name, category_a, category_b,
case when category_a = category_b then a.spend else f.spend + j.spend end as spend
select customer_name, category as category_a, evidencedspend as spend
from fac_spendtest c join dim_customer d on c.customer_key = d.customerkey
join dim_product e
View Complete Post