[SQL] Except without elimination of non-distinct rows

2008-02-04 Thread Ray Madigan
Is there any way to use except that won't remove the non-distinct rows from
the left side of the query?


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [SQL] Except without elimination of non-distinct rows

2008-02-04 Thread Tom Lane
"Ray Madigan" <[EMAIL PROTECTED]> writes:
> Is there any way to use except that won't remove the non-distinct rows from
> the left side of the query?

EXCEPT ALL might or might not do what you're hoping for.  Check the
manual (I think the SELECT reference page is what to look at).

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [SQL] Except without elimination of non-distinct rows

2008-02-04 Thread Ray Madigan
I tried using EXCEPT ALL but it seems to only remove one row when there is
more then one matching row?

Thanks
Ray Madigan


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Tom Lane
Sent: Monday, February 04, 2008 6:20 PM
To: Ray Madigan
Cc: Pgsql-Sql
Subject: Re: [SQL] Except without elimination of non-distinct rows


"Ray Madigan" <[EMAIL PROTECTED]> writes:
> Is there any way to use except that won't remove the non-distinct rows
from
> the left side of the query?

EXCEPT ALL might or might not do what you're hoping for.  Check the
manual (I think the SELECT reference page is what to look at).

regards, tom lane


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match