Created
August 11, 2009 16:10
-
-
Save emschwar/165926 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT manifests.campaign_id,SUM(delivery_item_entries.impressions) | |
FROM delivery_item_entries | |
INNER JOIN delivery_items on delivery_item_entries.delivery_item_id = delivery_items.id | |
INNER JOIN third_party_placements on delivery_items.third_party_placement_id = third_party_placements.id | |
INNER JOIN ordered_placements on third_party_placements.ordered_placement_id = ordered_placements.id | |
INNER JOIN placements on ordered_placements.id = placements.ordered_placement_id | |
INNER JOIN plan_rows on placements.plan_row_id = plan_rows.id | |
INNER JOIN plans on plan_rows.plan_id = plans.id | |
INNER JOIN manifests on plans.manifest_id = manifests.id | |
WHERE delivery_item_entries.closing_id = 1 | |
GROUP BY manifests.campaign_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment