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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: [Help] How to sort like this with SQL?

Re: [Help] How to sort like this with SQL?

From: Mark Lorenti <csvmxl_at_ADMIN.AC.EDU>
Date: Mon, 22 Jan 1996 10:22:23 EST
Message-Id: <9601221541.AA24790@alice.jcc.com>


Cho,

try

    select substr(to_char(work_item,'9.99'),1,length(work_item)+1)     from work_table
    order by to_char(work_item,'9.99')

or just use

    select work_item
    from   work_table
    order by to_char(work_item,'9.99')

    and left justify the work_item column.

HTH [...]
> I have the table with one column and it has
> some datas like this:
>
> 1
> 1.1
> 1.10
> 1.2
> 1.5
> 1.11
> 1.3
> 1.4
> 1.12
> ...
>
> If I select this with later statement you can
> get this result:
>
> SELECT Work_Item
> FROM Work_Table
> ORDER BY Work_Item;
>
> 1
> 1.1
> 1.10
> 1.11
> 1.12
> 1.2
> 1.3
> 1.4
> 1.5
> ...
>
> But I want to sort this datas like this:
>
> 1
> 1.1
> 1.2
> 1.3
> 1.4
> 1.5
> 1.10
> 1.11
> 1.12
> ...

--

Mark Lorenti, Systems Analyst II   ********************************************
Augusta College Computer Services  *In matters of style, go with the current. *
(706) 737-1484                     *In matters of principle,stand like a rock.*
GIST (706) 337-1484                *                  - Thomas Jefferson      *
e-mail: mlorenti_at_ac.edu            ********************************************

Received on Mon Jan 22 1996 - 10:41:10 CST

Original text of this message

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