In table 1 I have records with a status.
| key | Status | Combi | Parent |
|---|---|---|---|
| key1 | ABCD | 1 | 0 |
| key2 | ABCD | 1 | 0 |
| key3 | XYZ | 1 | 0 |
| key4 | XYZ | 1 | 1 |
| key5 | QWERT | 1 | 1 |
| key6 | ABCD | 0 | 0 |
In table 2 I have the parent child relationship
| key | Parentkey | Check |
|---|---|---|
| key1 | key4 | A |
| key2 | key4 | B |
| key3 | key5 | A |
| key4 | key4 | B |
| key5 | key5 | A |
The Result I'm looking for is a table with the ParentStatus. But only when Table1.Combi = 1 and Table1.Parent = 0 and Table2.Check = A. Like this:
| key | ParentStatus |
|---|---|
| key1 | XYZ |
| key2 | |
| key3 | QWERT |
| key4 | |
| key5 | |
| key6 |