I have a log table with dates associated with log items. To be used by publishers to display log ads Tracks Impressions from Ad Position It seems (very simplified) like this:
id | Date | Adspace_id | Impressions
When there is no impression for one day at an ad space, it should sometimes send 0. Other times, this is not just logged in. For the second time, adspace_id will be logged multiple times at the same time. (I do not know why.) I am trying to pull adspace_ids who have the value of each day in a 30 day period, but it does not understand how to do it. I have tried
SELECT adspace_id logstbl from WHERE (`dated` & gt;" 2014-02-01 "and` date` & lt; "2014-03-02") and impressions ! = 0
But it pulls any place with a log between those dates, which instead of one place with a log on all
I think I'm missing something, and any help would be greatly appreciated.
How many days you can calculate between those dates (for example, 30 days) And see ID for viewing with those many dates (this SQL can almost certainly be re-applied, but only one idea):
SELECT adspace_id (SELECT adspace_id, From date (date) to cnt (SELECT distinct adspace_id, logstbl from WHERE to date (`date` & gt;" 2014-02-01 "and` date` & lt; "2014-03-02") and impressions! = 0) a group by adspace_id) b where b.cnt & gt; 30
Comments
Post a Comment