On Dec 1, 2003, at 10:15 AM, Graham Leggett wrote:
Hi all,
I am trying to do a query that returns all rows that are _not_ part of
a join, and so far I cannot seem to find a query that doesn't take 30
minutes or more to run.
The basic query is "select * from tableA where tableA_id NOT IN (select
A suggestion is to use a left outer join and then test for rows with a
right-hand null value (ones where the join failed).
The following example creates 2 tables, t1 and t2.
t1 has related records in t2 and the relation is indicated by
t1.rel->t2.id
create table t1 (
id integer,
rel integer,
labe
Hello
If you can, use PostgreSQL version 7.4. There is some optimalisation for
this questions. You can change your query from select .. IN (select) to
select .. exists (select). More about it you can find in FAQ.
regards
Pavel
On Mon, 1 Dec 2003, Graham Leggett wrote:
> Hi all,
>
> I am tryi
> Graham Leggett
>
> Hi all,
>
> I am trying to do a query that returns all rows that are
> _not_ part of a join, and so far I cannot seem to find a
> query that doesn't take 30 minutes or more to run.
>
> The basic query is "select * from tableA where tableA_id NOT
> IN (select tableA_id fro
Hello
On Mon, 1 Dec 2003, Graham Leggett wrote:
> Hi all,
>
> I am trying to do a query that returns all rows that are _not_ part of
> a join, and so far I cannot seem to find a query that doesn't take 30
> minutes or more to run.
>
> The basic query is "select * from tableA where tableA_id