| From: | George Essig <george(dot)essig(at)gmail(dot)com> | 
|---|---|
| To: | Steven Verhoeven <Steven2(at)dmbr(dot)ugent(dot)be> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: sql question | 
| Date: | 2005-03-14 05:13:11 | 
| Message-ID: | 6744b385050313211333b5d009@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On Fri, 11 Mar 2005 13:26:07 +0100, Steven Verhoeven
<Steven2(at)dmbr(dot)ugent(dot)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;
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Fuhr | 2005-03-14 05:47:46 | Re: Question about accessing current row data inside trigger | 
| Previous Message | Bruno Wolff III | 2005-03-14 04:48:16 | Re: Postgres stored proc that extracts data from Oracle |