I'm attempting to build reports on data that I have.. The data is for advertising cost and revenue, here's a basic break down
Table: Clicks
id
campaign_id
cpc
date
Table: Sales
click_id
earned
click_date
I just want a query that returns the total cost (sum of cpc in clicks table) and total earned (sum of earned in sales table), then group it by each day. The problem I'm having is with summing the cpc in the clicks table, because when grouping by day it just returns one value, and doing a subquery doesn't seem to work.. so i'm not really sure...
If anyone is really good with SQL and thinks they'd have no problem doing this, please PM your rates, I have other queries along the similar lines as these.
OR if someone wants to post suggestions, thats fine too... Thanks!
SQL Guru needed
Moderator: General Moderators
Re: SQL Guru needed
Isn't that the point of performing the GROUP BY on the date column? To get one value per day? Or am I misreading your statement?GeXus wrote: I just want a query that returns the total cost (sum of cpc in clicks table) and total earned (sum of earned in sales table), then group it by each day. The problem I'm having is with summing the cpc in the clicks table, because when grouping by day it just returns one value...
Did you ever solve this?