Re: Oracle Sql-plus question

From: W. van der Deijl <W.van.der.Deijl_at_inter.nl.net>
Date: 1995/12/07
Message-ID: <DJ7DBp.JJ2_at_inter.NL.net>#1/1


awdorrin_at_kocrsv01.delcoelect.com (Albert W. Dorrington) wrote:

> I thought I had figured this out once before, but I can't
>seem to remember right now.
> Is there a way using an sqlplus query to have an order by
>clause actually order the numbers in numeric order,
>(1, 2, ... 10, 19, 20, etc) instead of its strange ordering
>(1, 10, 19, 2, 20, etc)
Try using this:
SELECT some_columns
FROM some_table ST
ORDER BY TO_NUMBER(ST.some_varchar_field);

This should work. Perhaps you have to give TO_NUMBER a format mask if the VARCHAR can containt strange characters (like currecny-signs etc.)

Bye,
Wilfred
The Netherlands Received on Thu Dec 07 1995 - 00:00:00 CET

Original text of this message