November 27, 2018
Hi - I have been trying to figure this out for quite some time...I feel like I have writers block, so I hope someone can help!!
I have two sets of data that I want to join, and see what matches and is different from each set.
I have Products that I need to compare to the standard Templates to determine what was built to the standard.
|* Rules are manually built on Products, and I want to know where they built something non-standard||Z||3||E|
|* Templates define the standard rule set|
I have 4 scenarios, all of which are valid:
- Products have Rule IDs that match and the Rules match
- Products that have Rule IDs that match and the Rules do not match
- Products that have Rule IDs not in my standard Templates
- Rule IDs which are in my standard Templates but not in my Product
I've tried full outer joins, but filling in the Product or Template is a challenge because I have more templates than may be in my Product table. I have used new fields to look at matches then filtered out what doesn't match and then joined back to the templates, but just cannot get the Product associated with the missing rules!
Does anyone have a suggestion/solution to try? I've included a file with these two tables. I'm hoping there is a simple, elegant solution that is staring me in the face, and you will enlighten me with your genius!!
Thank you so much - Beth
July 16, 2010
You need 4 separate queries here, one for each scenario. The join type will differ depending on the scenario. Have you seen this post which explains the different join types and when to use them?