Re: union query returning duplicates - Mailing list pgsql-general

From Alvaro Herrera Munoz
Subject Re: union query returning duplicates
Date
Msg-id 20041020125226.GA28375@dcc.uchile.cl
Whole thread Raw
In response to Re: union query returning duplicates  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
On Wed, Oct 20, 2004 at 01:54:04PM +0200, Sim Zacks wrote:
> It is very weird, I just tried both a group by and distinct and both
> of them still return the duplicates.
>
> I also tried a very simple union which didn't return any duplicates,
> both of these said, it is obviously not a problem with union.

Not related to your underlying problem, but be aware that UNION does
eliminate duplicates by design, so that could explain what you are seeing
here.  If you don't want it to do that, use UNION ALL instead (the same
applies to INTERSECT and EXCEPT if you ever happen to use them).

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Saca el libro que tu religión considere como el indicado para encontrar la
oración que traiga paz a tu alma. Luego rebootea el computador
y ve si funciona" (Carlos Duclós)

pgsql-general by date:

Previous
From: Sim Zacks
Date:
Subject: Re: union query returning duplicates
Next
From: Josh Close
Date:
Subject: Re: how much ram do i give postgres?