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 C9726563D6 for ; Mon, 14 Mar 2005 02:42:34 +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 35652-07 for ; Mon, 14 Mar 2005 02:42:31 +0000 (GMT) Received: from smtp.inreach.com (209-142-2-36.stk.inreach.net [209.142.2.36]) by svr1.postgresql.org (Postfix) with SMTP id 9435F563E3 for ; Mon, 14 Mar 2005 02:42:30 +0000 (GMT) Received: (qmail 16984 invoked from network); 14 Mar 2005 02:54:23 -0000 Received: from [209.239.173.94] (HELO HOMEOFFICE) (209.239.173.94) by smtp.inreach.com (qpsmtpd/0.28) with SMTP; Sun, 13 Mar 2005 18:54:23 -0800 Message-ID: <00f301c5283f$8074dc00$6501a8c0@HOMEOFFICE> From: "Vincent Hikida" To: "Vincent Hikida" , "Steven Verhoeven" , , References: <423190C1.5090406@dmbr.UGent.be> <003101c5283e$6bb20780$6501a8c0@HOMEOFFICE> Subject: Re: [NOVICE] sql question Date: Sun, 13 Mar 2005 18:42:43 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00F0_01C527FC.71573670" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_EXIST_TBODY, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200503/574 X-Sequence-Number: 74889 This is a multi-part message in MIME format. ------=_NextPart_000_00F0_01C527FC.71573670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable OOPs. I mean SELECT t1.id , t1.fref FROM t1 UNION ALL SELECT t1.id , t1.mref FROM t1 ----- Original Message -----=20 From: Vincent Hikida=20 To: Steven Verhoeven ; pgsql-general@postgresql.org ; = pgsql-novice@postgresql.org=20 Sent: Sunday, March 13, 2005 6:34 PM Subject: Re: [NOVICE] [GENERAL] sql question SELECT t1.id , t1.fref FROM t1 UNION ALL SELECT t2.id , t2.mref FROM t2 ----- Original Message -----=20 From: Steven Verhoeven=20 To: pgsql-general@postgresql.org ; pgsql-novice@postgresql.org=20 Sent: Friday, March 11, 2005 4:36 AM Subject: [GENERAL] sql question Hi all=20 My table definition : id | fref | mref ------+-----------+---------- 1 | 23 | 25 2 | 24 | 28 3 | 25 | 31 4 | 26 | 34 My problem :=20 i need a query that results in this : id | ref ------+---------- 1 | 23 =20 1 | 25 2 | 24 2 | 28 3 | 25 =20 3 | 31 4 | 26 =20 4 | 34 Do I need a crosstab-query ? Who can help me ? --=20 A computer is like an airconditioner. When windows open, it stops = working ! =20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- = -- -- -- -- -- -- -- -- -- -- -- -- -- -- --=20 Steven Verhoeven, ICT Support Engineer=20 Department for Molecular Biomedical Research (DMBR) VIB - Ghent University 'Fiers-Schell-Van Montagu' building Technologiepark 927B - 9052 Ghent (Zwijnaarde) Belgium=20 Tel : +32-(0)9-33-13.606=20 Fax : +32-(0)9-33-13.609 E-mail : = Steven.Verhoeven@dmbr.UGent.be=20 URL : http://www.dmbr.UGent.be=20 ------=_NextPart_000_00F0_01C527FC.71573670 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
OOPs.
 
I mean
 
SELECT  t1.id
          &nbs= p;  =20 ,  t1.fref
    FROM t1
UNION ALL
SELECT t1.id
          &nbs= p;  =20 , t1.mref
    FROM = t1
----- Original Message -----
From:=20 Vincent=20 Hikida
To: Steven Verhoeven ; = pgsql-general@postgresql.org= ;=20 pgsql-novice@postgresql.org=20
Sent: Sunday, March 13, 2005 = 6:34=20 PM
Subject: Re: [NOVICE] [GENERAL] = sql=20 question

SELECT  t1.id
          &nbs= p;  =20 ,  t1.fref
    FROM = t1
UNION ALL
SELECT t2.id
          &nbs= p;  =20 , t2.mref
    FROM = t2
 
----- Original Message -----
From:=20
Steven Verhoeven =
To: pgsql-general@postgresql.org= =20 ; pgsql-novice@postgresql.org=20
Sent: Friday, March 11, 2005 = 4:36=20 AM
Subject: [GENERAL] sql = question

Hi all

My table definition = :

  =20 id | fref      |=20 mref
------+-----------+----------
  1  =20 |     23    |   = 25
 =20 2   |     24    = |  =20 28
  3   |     = 25   =20 |   31
  4   |    =20 26    |   34


My problem :
i = need a=20 query that results in this :

   id = |   =20 ref
------+----------
  1   = |    =20 23  
  1   |    =20 25
  2   |     24
 =20 2   |     28
  3  =20 |     25   
  = 3  =20 |     31
  4  =20 |     26   
  = 4  =20 |     34



Do I need a = crosstab-query=20 ?
Who can help me ?


------=_NextPart_000_00F0_01C527FC.71573670--