Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql select question
thanx.
this brings me closer.
Billy Verreynne <vslabs_at_onwe.co.za> wrote in message news:<b2vat8$rrh$1_at_ctb-nnrp2.saix.net>...
> ayrobins wrote:
>
> > All i want is to transform the name of a name/value table into a specific
> > column.
> > specifically i have a table called conn_address
> >
> > name value
> > --------- ----------------
> > host xxx
> > port 123
> >
> > so i want to do a select on conn address where the result would be.
> > xxx 123
> > on the same row.
>
> Try something like this:
>
> SQL> create table tst ( a number, b varchar2(20), c varchar(20) );
>
> Table created.
>
> SQL> insert into tst values( 1, 'name1', 'value1' );
>
> 1 row created.
>
> SQL> insert into tst values( 1, 'name2', 'value2' );
>
> 1 row created.
>
> SQL> insert into tst values( 2, 'name3', 'value3' );
>
> 1 row created.
>
> SQL> insert into tst values( 2, 'name4', 'value4' );
>
> 1 row created.
>
> SQL> insert into tst values( 3, 'name5', 'value5' );
>
> 1 row created.
>
> SQL> SELECT
> 2 t1.c, t2.c
> 3 FROM tst t1, tst t2
> 4 WHERE t1.a = t2.a
> 5 AND t1.b < t2.b;
>
> C C
> -------------------- --------------------
> value1 value2
> value3 value4
Received on Wed Feb 19 2003 - 12:56:36 CST
![]() |
![]() |