Simple Question - SQL for retrieving different row
I have two tables:
tableA has a field numberA, which has rows:
1
2
4
tableB has a field numberB, which has rows:
1
2
3
When I use SQL:
select numberB
from tableA and tableB
where tableA.numberA <> tableB.numberB
I expect to output 3 only, but actually, I output many numbers. It seems to be that for each row in tableA, it looks for all different numbers in tableB. My question is what is the simple way to output 4 in tableB only?
This may be a trivial question. Many thanks to any suggestion.
|