I have the following tables:
Table 1:
Number PK | Word PK |
---|---|
1 | A |
1 | B |
1 | C |
2 | B |
2 | A |
2 | C |
3 | J |
3 | K |
3 | B |
Table 2:
Number2 | Word2 |
---|---|
1 | A |
2 | X |
3 | B |
I want to select the rows of the second table in which the word (Word2) is related with the rows of table 1 in which (Number Pk) is the same as (Number 2). For example, in the first row of the second table we can see Number2=1 and Word2=A, so I would want the program to search in the first table where Number Pk=1 and see if it is related with A, so it is related with A, B and C. So it meets the condition that it is related with A, so that row of the second column would be a solution.
Output:
Number | Word |
---|---|
1 | A |
3 | B |
4
Answers
I haven’t tested this but this logically or similar should work.
I don’t know your exact field and table names but presumably something along the lines of this would do what you are looking for:
Try
This should work:
If you have other columns in
Table 2
you wish to include: