August 10, 2011 at 10:45 pm
Greetings,
I need your expertise on my issue. I do two tables, each has only one simple column (varchar(500) type). Also, each table has roughly about 4 million rows. What is the best way to write a query that show rows in tableA are not in tableB?
Your guidance or sample query is truly appreciated.
john9569
MSSQL server 2008
August 11, 2011 at 12:49 am
john9569 (8/10/2011)
Greetings,I need your expertise on my issue. I do two tables, each has only one simple column (varchar(500) type). Also, each table has roughly about 4 million rows. What is the best way to write a query that show rows in tableA are not in tableB?
Your guidance or sample query is truly appreciated.
john9569
MSSQL server 2008
Look up INTERSECT in Books On-line.
August 11, 2011 at 2:48 am
This was removed by the editor as SPAM
August 11, 2011 at 7:52 am
Why not to use simple old LEFT JOIN:
SELECT a.OneColumn
FROM TableA AS a
LEFT JOIN TableB AS b ON b.OneColumn = a.OneColumn
WHERE b.OneColumn IS NULL
I do assume that there are no rows with NULL values...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply