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 03A2E55112; Fri, 11 Mar 2005 12:36:30 +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 14084-01; Fri, 11 Mar 2005 12:36:21 +0000 (GMT) Received: from smtp.dmbr.UGent.be (dmbr242.fvms.ugent.be [157.193.189.5]) by svr1.postgresql.org (Postfix) with ESMTP id 59DA656472; Fri, 11 Mar 2005 12:36:17 +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 42BF4800FE; Fri, 11 Mar 2005 13:36:20 +0100 (CET) Message-ID: <423190C1.5090406@dmbr.UGent.be> Date: Fri, 11 Mar 2005 13:36:17 +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, pgsql-novice@postgresql.org Subject: sql question Content-Type: multipart/alternative; boundary="------------020003000904080806000400" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.329 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_EXIST_TBODY, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200503/555 X-Sequence-Number: 74870 This is a multi-part message in MIME format. --------------020003000904080806000400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 ? -- /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 --------------020003000904080806000400 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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 ?


--
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



--------------020003000904080806000400--