Created
August 12, 2009 20:04
-
-
Save emschwar/166720 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 agencies.name | |
FROM agencies | |
INNER JOIN manifests ON manifests.agency_id = agencies.id | |
INNER JOIN plans ON plans.manifest_id = manifests.id | |
INNER JOIN plan_rows ON plan_rows.plan_id = plans.id | |
INNER JOIN placements ON placements.plan_row_id = plan_rows.id | |
INNER JOIN ordered_placements ON placements.ordered_placement_id = ordered_placements.id | |
WHERE ordered_placement_id = 87952 | |
AND plans.id = MAX(plans.id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment