Join Statements

From: tconti(at)hotmail(dot)com (T Conti)
To: pgsql-sql(at)postgresql(dot)org
Subject: Join Statements
Date: 2002-02-11 15:15:37
Message-ID: 5e0d3eda.0202110715.764ff25f@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Howdy:

I need to put together an SQL statement that will return all of the
rows in table A that are not in table B. Table A and B have the same
primary key. For example:

select count(a.*)
from a (nolock) left outer join
b (nolock) on a.id = b.id
where a.id != b.id

This did not work. It returned 0 rows. I know that this could be
done very easily in a sub-select, but that seems inefficient. Is
there any way to accomplish what I mentioned above in the join
statement or is the sub-select the way to go?

Thanks for the help,
Tom

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message mallah 2002-02-11 15:19:17 Re: Sequences
Previous Message Hunter, Ray 2002-02-11 15:12:33 Re: Sequences