Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

selecting when a value doesn't not exist in a second taable

$
0
0

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
RelatedKeyTypeColor
123carred
123cargreen
123carBlue
124carYellow
124cargreen
124carBlue

the

 

Table 1
Key
123
124

 

 

Table 2
RelatedKeyTypeColor
123carred
123cargreen
123carBlue
124carYellow
124cargreen
124carBlue

Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>