pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George Essig <george.essig@gmail.com>
To: Steven Verhoeven <Steven2@dmbr.ugent.be>
Cc: pgsql-general@postgresql.org
Subject: Re: sql question
Date: Sun, 13 Mar 2005 23:13:11 -0600
Message-ID: <6744b385050313211333b5d009@mail.gmail.com> (raw)
In-Reply-To: <42318E5F.4080207@dmbr.ugent.be>
References: <42318E5F.4080207@dmbr.ugent.be>

On Fri, 11 Mar 2005 13:26:07 +0100, Steven Verhoeven
<Steven2@dmbr.ugent.be> 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;



view thread (71+ messages)  latest in thread

Message-ID: <6744b385050313211333b5d009@mail.gmail.com>
Permalink:  ../6744b385050313211333b5d009@mail.gmail.com/
Also on:    postgresql.org/message-id/6744b385050313211333b5d009@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: george.essig@gmail.com, Steven2@dmbr.ugent.be
  Subject: Re: sql question
  In-Reply-To: <6744b385050313211333b5d009@mail.gmail.com>
  References: <42318E5F.4080207@dmbr.ugent.be> <6744b385050313211333b5d009@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox