pedrosolorzano
Programmer
Hi All:
I don't know which forum is the right one to post this question, in fact, I post it here because I usually work with PostgreSQL, but it is a really newbbie question about SQL:
Say I have a table (or view) "A" with one column which content are numbers from 1 to 5:
A =
number
-----+
1
2
3
4
5
If i have another table B with the same column but numbers from 1 to 10:
B=
number
-----+
1
2
3
4
5
6
7
8
9
10
How can I get B-A?
In other words, how is the query to get:
number
-----+
6
7
8
9
10
from the join of the A and B tables?
I mean,
"what IS in B and IS NOT in A",
the complement or difference or something similar.
I know it is a dummie question but I really appreciate any help.
Thanks in advance for any answer.
Best Regards.
I don't know which forum is the right one to post this question, in fact, I post it here because I usually work with PostgreSQL, but it is a really newbbie question about SQL:
Say I have a table (or view) "A" with one column which content are numbers from 1 to 5:
A =
number
-----+
1
2
3
4
5
If i have another table B with the same column but numbers from 1 to 10:
B=
number
-----+
1
2
3
4
5
6
7
8
9
10
How can I get B-A?
In other words, how is the query to get:
number
-----+
6
7
8
9
10
from the join of the A and B tables?
I mean,
"what IS in B and IS NOT in A",
the complement or difference or something similar.
I know it is a dummie question but I really appreciate any help.
Thanks in advance for any answer.
Best Regards.