X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D295B5659C for ; Mon, 14 Mar 2005 17:50:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02295-08 for ; Mon, 14 Mar 2005 17:50:12 +0000 (GMT) Received: from mail.travelamericas.com (unknown [206.130.134.147]) by svr1.postgresql.org (Postfix) with SMTP id 68140567C6 for ; Mon, 14 Mar 2005 17:50:10 +0000 (GMT) Received: (qmail 6564 invoked from network); 14 Mar 2005 17:50:10 -0000 Received: from unknown (HELO ?10.0.0.253?) (10.0.0.253) by verkiel.travelamericas.com with SMTP; 14 Mar 2005 17:50:10 -0000 Message-ID: <4235CED1.6070309@travelamericas.com> Date: Mon, 14 Mar 2005 09:50:09 -0800 From: Chris Travers User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steven Verhoeven , pgsql-general Subject: Re: sql question References: <423190C1.5090406@dmbr.UGent.be> In-Reply-To: <423190C1.5090406@dmbr.UGent.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.036 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/622 X-Sequence-Number: 74937 Steven Verhoeven wrote: > Hi all > > My table definition : > > id | fref | mref > ------+-----------+---------- > 1 | 23 | 25 > 2 | 24 | 28 > 3 | 25 | 31 > 4 | 26 | 34 > > My problem : > i need a query that results in this : > > id | ref > ------+---------- > 1 | 23 > 1 | 25 > 2 | 24 > 2 | 28 > 3 | 25 > 3 | 31 > 4 | 26 > 4 | 34 > > > Do I need a crosstab-query ? > Who can help me ? How about select id, mref AS ref from table UNION select id, fref AS ref from table Or is that not what you want? Best Wishes, Chris Travers Metatron Technology Consulting > > > -- > /A computer is like an airconditioner. When windows open, it stops > working ! / > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- > > Steven Verhoeven, ICT Support Engineer > > > Department for Molecular Biomedical Research (DMBR) > VIB - Ghent University 'Fiers-Schell-Van Montagu' building > Technologiepark 927B - 9052 Ghent (Zwijnaarde) > Belgium > Tel : +32-(0)9-33-13.606 > Fax : +32-(0)9-33-13.609 E-mail : Steven.Verhoeven@dmbr.UGent.be > URL : http://www.dmbr.UGent.be > > >