Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Transpose problem...
S=(select code,STOP_1 from toto) union (select code,STOP_2 from toto) union
(select code,STOP_3 from toto).
if you want order the result :
select * from S order by 1;
"Ste" <stro_at_solari.it> a écrit dans le message news:
3b2044af.0207230157.1253fe0f_at_posting.google.com...
> Hi all,
> I've got this problem. My original table is:
>
> CODE | STOP_1 | STOP_2 | STOP_3
> 001 | ABC | DEF | GHI
> 002 | LMN | OPQ | RST
>
> Where CODE is my primary key.
> I'de like to get a view that gives the result in this form:
>
> CODE | STOPS_LIST |
> 001 | ABC |
> 001 | DEF |
> 001 | GHI |
> 002 | LMN |
> 002 | OPQ |
> 002 | RST |
>
> I've played around DECODE but seems to solve the reversed problem.
> Thanks in advance.
Received on Tue Jul 23 2002 - 05:17:27 CDT