Created
January 3, 2013 03:59
-
-
Save kevinchampion/4440661 to your computer and use it in GitHub Desktop.
Query optimization
This file contains hidden or 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 | |
n.nid as nid | |
FROM node n | |
INNER JOIN content_field_revenue_unit_ref r ON r.nid = n.nid | |
INNER JOIN content_type_tax_reporting_units u ON u.nid = r.field_revenue_unit_ref_nid | |
LEFT JOIN content_type_tax_sales_report t ON n.nid = t.field_sales_revenue_ref_nid | |
AND t.field_sales_activity_month_value = 12 | |
AND t.field_sales_activity_year_value = 2012 | |
WHERE n.type = 'tax_revenue_source' | |
AND u.field_reporting_unit_status_value = 'A' | |
AND n.status = 1 | |
AND t.nid IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment