In the below example I have two tables where the Key field in table 1 and the RelatedKey in Table 2 have a Left out join from table 1 to table 2. The issue I'm trying to solve is finding the data in the table 1 Key field where the world Yellow doesn't exist in Table 2 color field. Table 2 may have multiple rows with the same relatedkey and multiple colors.
In the below example the result should be Table1.Key = 123 (since Yellow doesn't not exist for relatedkey 123)
Table 2 | ||
RelatedKey | Type | Color |
123 | car | red |
123 | car | green |
123 | car | Blue |
124 | car | Yellow |
124 | car | green |
124 | car | Blue |
the
Table 1 |
Key |
123 |
124 |
Table 2 | ||
RelatedKey | Type | Color |
123 | car | red |
123 | car | green |
123 | car | Blue |
124 | car | Yellow |
124 | car | green |
124 | car | Blue |