Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sort

Re: sort

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 10 Nov 2003 21:49:44 -0800
Message-ID: <1a75df45.0311102149.1211a043@posting.google.com>


mabraham_tp_at_hotmail.com (Mary) wrote :

> I have two lists (19,21,20,22,23) and (1,2,3,4,5). The second list
> corresponds to the values in the first list. I would like to sort the
> first list as (19,20,21,22,23) As a result the second list should
> become (1,3,2,4,5)
>
> How should I do this? Please help

create table lists
( seqnum number(3),

     value number(6)
)

insert into lists values(1, 19)
insert into lists values(2, 21)
..etc.
insert into lists values(5, 23)

select
  value "LIST1",
  seqnum "LIST2"
from lists
order by 2

Now if this is not what you're looking for, comp.databases.oracle.* is not the the place for you and you're postings are off-topic, n.a. and not welcomed.

--
Billy
Received on Mon Nov 10 2003 - 23:49:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US