SQL Guru needed
Posted: Wed Apr 09, 2008 12:35 am
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!
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!