X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 21F5D9F9D99 for ; Mon, 22 May 2006 16:07:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 01154-03 for ; Mon, 22 May 2006 16:07:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by postgresql.org (Postfix) with ESMTP id 20AAF9F9B01 for ; Mon, 22 May 2006 16:07:38 -0300 (ADT) Received: from [134.60.236.94] (helo=lunix.schabi.de) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2Dk-1FiFkb14Gx-0000fT; Mon, 22 May 2006 21:07:33 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lunix.schabi.de (Postfix) with ESMTP id 331561EE31F; Mon, 22 May 2006 21:07:34 +0200 (CEST) Message-ID: <44720BF6.6050109@logix-tt.com> Date: Mon, 22 May 2006 21:07:34 +0200 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: mark.dingee@cox.net CC: pgsql-sql@postgresql.org Subject: Re: Question on UNION References: <21062336.1148324291670.JavaMail.root@eastrmwml05.mgt.cox.net> In-Reply-To: <21062336.1148324291670.JavaMail.root@eastrmwml05.mgt.cox.net> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:a9554655f07a4e401310f2acfb43f5bf X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/171 X-Sequence-Number: 25202 Hi, Mark, mark.dingee@cox.net schrieb: > I ran into something I wasn't expecting while developing a new > application. I have two similar tables that are occasionally unioned > pulling only about 3 fields from each. During my testing phase I > noticed that the union statement was returning what appeared to be a > distinct list rather than a pure union such as is illustrated below: This is the documented behaviour of UNION, if you don't wand duplicate elimination, use UNION ALL. http://www.postgresql.org/docs/8.1/static/sql-select.html documents this nicely. HTH, Schabi