Created
January 9, 2013 17:58
-
-
Save ryancole/4495272 to your computer and use it in GitHub Desktop.
Query for records with more than X number of foreign key matches.
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 t.emplid | |
| FROM term_file t | |
| WHERE t.emplid IN (SELECT v.custodian_id FROM evidence_main v GROUP BY v.custodian_id HAVING COUNT(v.custodian_id) > 50) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment