Created
September 15, 2014 19:15
-
-
Save jwliechty/92ed4f55973e676b169c to your computer and use it in GitHub Desktop.
Find id's of a dimension referenced from a fact table via multiple attributes.
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 dim.id FROM dim WHERE dim.id NOT IN | |
( | |
SELECT DISTINCT fact.dim_one_id FROM fact | |
) | |
AND dim.id NOT IN | |
( | |
SELECT DISTINCT fact.dim_two_id FROM fact | |
) | |
AND dim.id NOT IN | |
( | |
SELECT DISTINCT fact.dim_three_id FROM fact | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment