I'm sure there is an easy solution to what I'm trying to do but I just can't think through it.
Table A - Columns - ITEMNUM - ITEMNAME
1 Test1
2 Test2
3 Test3
4 Test4
5 Test5
6 Test6
Table B - columns - ITEMNUM CHAR
1 A
1 B
2 A
2 C
3 A
3 D
4 A
4 E
5 A
5 F
6 A
6 F
What I want to do is
select itemname
from A, b
where a.itemnum = b.itemnum
and then I only want the rows where char = 'A' but not when there is also B, C, or D with the same itemnum. The itemnum must have a char be 'A' and then it might be something else with the same itemnum but it can't be B,C, or D. Not all itemnum's will have a char with a value of 'A'. Hopefully that makes sense.
Test4, Test5, and Test6 should be the only ones returned.
I have to put this code into another program that won't let me use pl/sql.
Suggestions?