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 A103BD1B437 for ; Thu, 13 May 2004 05:07:28 -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 25315-08 for ; Thu, 13 May 2004 05:07:09 -0300 (ADT) Received: from relay2.mail2web.com (relay2.mail2web.com [168.144.1.82]) by svr1.postgresql.org (Postfix) with ESMTP id 88875D1E791 for ; Thu, 13 May 2004 05:07:07 -0300 (ADT) Received: from M2W099.mail2web.com ([168.144.251.212]) by relay2.mail2web.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 13 May 2004 04:07:08 -0400 Message-ID: <323910-220045413878445@M2W099.mail2web.com> X-Priority: 3 Reply-To: ashok@kalculate.com X-Originating-IP: 61.16.132.195 X-URL: http://mail2web.com/ From: "ashok@kalculate.com" To: pgsql-sql@postgresql.org Subject: a wierd query Date: Thu, 13 May 2004 04:07:08 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 13 May 2004 08:07:08.0494 (UTC) FILETIME=[496CFEE0:01C438C1] X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.8 tagged_above=0.0 required=5.0 tests=PRIORITY_NO_NAME X-Spam-Level: X-Archive-Number: 200405/115 X-Sequence-Number: 17829 hi=20 i have a wierd problem and i require an equally weird query. 1) backgound Table test: CREATE TABLE main_table ( string_A varchar( 20), string_B varchar( 20), ); -- both columns are identical in nature and usage INSERT INTO main_table VALUES('abcd','qrst'); INSERT INTO main_table VALUES('efgh','efgh'); INSERT INTO main_table VALUES('ijkl','abcd'); INSERT INTO main_table VALUES('abcd','ijkl'); INSERT INTO main_table VALUES('qrst','uvwx'); 2) problem: =20=20=20 i require a query that gives me a result set of the form 'abcd' 'efgh' 'ijkl' 'qrst' 'uvwx' that is i require the dictinct values from (visualizing each column result as a set) the union of the two columns 3) questions a) is a query like this possible that can give me the desired result b) if so what would it be. 4) remarks =20=20=20 i can get the solution using a temporary table and with repeated "insert into temporary select $column from main_table" thanks in advance ashok -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .