X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E9ABDD1B17D for ; Fri, 14 May 2004 01:39:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05106-05 for ; Fri, 14 May 2004 01:39:21 -0300 (ADT) Received: from rock.spider.ru (rock.spider.ru [62.183.34.226]) by svr1.postgresql.org (Postfix) with ESMTP id 84E48D1B1B8 for ; Fri, 14 May 2004 01:39:19 -0300 (ADT) Received: from rock (localhost [127.0.0.1]) by rock (Postfix) with SMTP id 66DA691377 for ; Fri, 14 May 2004 08:39:17 +0400 (MSD) Received: from sad.localnet.ru (sad.localnet.ru [10.0.0.33]) by rock.spider.ru (Postfix) with ESMTP id AD4E891372 for ; Fri, 14 May 2004 08:39:16 +0400 (MSD) Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: pgsql-sql@postgresql.org Subject: Re: a wierd query Date: Fri, 14 May 2004 07:45:48 +0400 User-Agent: KMail/1.4.3 References: <323910-220045413878445@M2W099.mail2web.com> <200405131134.35156.sad@bankir.ru> <40A393FF.3030806@onesystem.com> In-Reply-To: <40A393FF.3030806@onesystem.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200405140745.48296.sad@bankir.ru> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/128 X-Sequence-Number: 17842 On Thursday 13 May 2004 19:27, you wrote: > sad wrote: > > select distinct a as F from table > > union > > select distinct b as F from table; > > Note that UNION only returns the unique values of the union > You can get repeated values by using UNION ALL. read the original problem look at the DISTINCT clause in my query and think again