I would like to write a query that outputs a / c (a divided by c) Grouped By the variable called cobrand_id.
What is the most seamless way to write this query? Thank you.
select sum(calc) a, cobrand_id b
from temp_08.jwn_calc
where optimized_transaction_date > '2015-10-31'
and optimized_transaction_date <= '2015-10-31' + 45
GROUP BY cobrand_id
select sum(calc) c, cobrand_id d
from temp_08.jwn_calc
where optimized_transaction_date > '2015-10-31'
and optimized_transaction_date <= '2015-10-31' + 91
GROUP BY cobrand_id