Non Matching Records in Two Tables

From: Ken Hill <ken(at)scottshill(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Non Matching Records in Two Tables
Date: 2006-02-08 21:10:23
Message-ID: 1139433024.2044.48.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I need some help with a bit of SQL. I have two tables. I want to find
records in one table that don't match records in another table based on
a common column in the two tables. Both tables have a column named
'key100'. I was trying something like:

SELECT count(*)
FROM table1, table2
WHERE (table1.key100 != table2.key100);

But the query is very slow and I finally just cancel it. Any help is
very much appreciated.

-Ken

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2006-02-08 21:27:04 Re: Non Matching Records in Two Tables
Previous Message Owen Jacobson 2006-02-08 18:18:46 Re: Delete with join -- deleting related table entries?