Link to home
Start Free TrialLog in
Avatar of thedaveg155
thedaveg155

asked on

Compare two columns in different tables and extract difference between them

I am using MS-SQL Query Analyser.

I have two tables ("A" & "B") that both have a column named "X".  Both columns contain the same type of information.  There are some differences betwen the contents of the 2 columns.

In particular, Table A col X contains a list of approx 100000 distinct numbers.  Table B col X contains approx 1 million numbers (not distinct).

I need to find out which numbers in table B col X do not exist in table A col X.  Help please!!!!!!  Thank you!
Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

This works in Oracle, I think you can change it if neccessary to  MS-SQL:

Select X from B
MINUS
Select X from A;
ASKER CERTIFIED SOLUTION
Avatar of thedaveg155
thedaveg155

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can ask 0-point question in a Community Support for refunding points :)
Avatar of Mike McCracken
Mike McCracken

This question has been answered by the asker.

mlmcc
DB Reporting Tools PE