i joined 2 tables and summed the metrics by month. the problem is that the inner query is working but in the top select it doesn’t show the relevant data but copy the sum.
example: select br. date, sum(ga.cost), sum(ga. clicks),sum(br.users),avg(ga.cpc)
from business as br
left join (select date,sum(cost),sum(clicks)
where DATE_FORMAT(date,’%Y-%m’) between ‘2019-01’ and ‘2020-02’
group by 1) as ga
where DATE_FORMAT(br.date,’%Y-%m’) between ‘2019-01’ and ‘2020-02’
group by 1
What is the problem/?
another ques. Is this the right way to summarize data form year and month?