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 C7B485639A for ; Fri, 11 Mar 2005 12:26:22 +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 09850-07 for ; Fri, 11 Mar 2005 12:26:14 +0000 (GMT) Received: from smtp.dmbr.UGent.be (dmbr242.fvms.ugent.be [157.193.189.5]) by svr1.postgresql.org (Postfix) with ESMTP id 20278563C2 for ; Fri, 11 Mar 2005 12:26:10 +0000 (GMT) Received: from [10.0.0.15] (53-86.240.81.adsl.skynet.be [81.240.86.53]) by smtp.dmbr.UGent.be (Postfix) with ESMTP id 65504800FE for ; Fri, 11 Mar 2005 13:26:10 +0100 (CET) Message-ID: <42318E5F.4080207@dmbr.ugent.be> Date: Fri, 11 Mar 2005 13:26:07 +0100 From: Steven Verhoeven Organization: VIB/UGent Dep. Molecular & Biomedical Research User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: sql question 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.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/556 X-Sequence-Number: 74871 My table definition : id | fref | mref ------+-----------+---------- 1 | 23 | 25 2 | 24 | 28 3 | 25 | 31 4 | 26 | 34 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 ?