Created
September 8, 2016 21:38
-
-
Save gordonje/1e52a7e6940564d22bb0b97bc069d22e to your computer and use it in GitHub Desktop.
filing_ids and amendments missing cover sheets
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 a."FILING_ID", a."AMEND_ID", COUNT(*) | |
FROM "SMRY_CD" a | |
LEFT JOIN "CVR_CAMPAIGN_DISCLOSURE_CD" b | |
ON a."FILING_ID" = b."FILING_ID" | |
AND a."AMEND_ID" = b."AMEND_ID" | |
WHERE b."FILING_ID" IS NULL | |
AND a."FORM_TYPE" IN ( | |
-- get the possible SMRY_CD form_type values for the F460 filings in CVR_CAMPAIGN_DISCLOSURE_CD | |
SELECT DISTINCT a."FORM_TYPE" | |
FROM "SMRY_CD" a | |
JOIN "CVR_CAMPAIGN_DISCLOSURE_CD" b | |
ON a."FILING_ID" = b."FILING_ID" | |
AND a."AMEND_ID" = b."AMEND_ID" | |
WHERE b."FORM_TYPE" = 'F460' | |
) | |
GROUP BY 1, 2 | |
ORDER BY 1, 2; |
Author
gordonje
commented
Sep 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment