Exclusive Values

R

Raul Sousa

Hello all

I have two tables. Both have a field called NSerie. There is no relation
between them.
I need to retrieve NSerie which are common to both tables. I can do that, no
problem.
I also need to retrieve NSerie which are not common to both table. This is,
I need those NSerie from table A which are not present on table B.

Any suggestions are most welcome.
 
W

Wolfgang Kais

Hello Raul.

Raul said:
I have two tables. Both have a field called NSerie.
There is no relation between them.
I need to retrieve NSerie which are common to both tables.
I can do that, no problem.
I also need to retrieve NSerie which are not common to both table.
This is,
I need those NSerie from table A which are not present on table B.
Any suggestions are most welcome.

Try this:
SELECT NSerie AS [Not present in B]
FROM TableA RIGHT JOIN TableB
ON TableA.NSerie = TableB.NSerie
WHERE TableB.NSerie IS NULL

There is a wizard for searching for inconsistencies that can help you create
this query.
 
Top