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 C956C5643E for ; Mon, 14 Mar 2005 05:13:26 +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 77548-01 for ; Mon, 14 Mar 2005 05:13:16 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by svr1.postgresql.org (Postfix) with ESMTP id 7AE9B56418 for ; Mon, 14 Mar 2005 05:13:14 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 70so1582315wra for ; Sun, 13 Mar 2005 21:13:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=pm6jAl53DMpOBGY0XpXB/cmgRTxptrG0QzuExcZO1tSWP6GkzROu2AHDX4MVVVgRXhj3d9x8u+KJIdkGr7vYI9bRPuYE5seQaTe4mdCw47vh+TNsUcqWeBa6Gzyi0OlZmVyylnEUrd7v48ymgYTn0KYCqj8awC/Qslv7cT7ybo8= Received: by 10.54.77.7 with SMTP id z7mr1674935wra; Sun, 13 Mar 2005 21:13:14 -0800 (PST) Received: by 10.54.52.40 with HTTP; Sun, 13 Mar 2005 21:13:11 -0800 (PST) Message-ID: <6744b385050313211333b5d009@mail.gmail.com> Date: Sun, 13 Mar 2005 23:13:11 -0600 From: George Essig Reply-To: George Essig To: Steven Verhoeven Subject: Re: sql question Cc: pgsql-general@postgresql.org In-Reply-To: <42318E5F.4080207@dmbr.ugent.be> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <42318E5F.4080207@dmbr.ugent.be> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.315 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200503/580 X-Sequence-Number: 74895 On Fri, 11 Mar 2005 13:26:07 +0100, Steven Verhoeven wrote: > 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 ? select id, fref as ref from my_table union select id, mref as ref from my_table;