Re: Oracle Sql-plus question
Date: 1995/12/07
Message-ID: <4a555c$jos_at_inet-nntp-gw-1.us.oracle.com>#1/1
You must be storing your numbers in chars or varchars which accounts for the 'strange' ordering (it is sorting character wise, not numerically).
try
select * from mytable order by to_number(mycolumn)
Better yet, try storing the numbers in a number column
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)
> Thanks in advance,
> Al
>--
>Al Dorrington
>awdorrin_at_ictest.delcoelect.com Database Admin
>Delco Electronics - IC CIM Unix Sysadmin
>Kokomo, Indiana, USA Phone: 317.451.9655
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Received on Thu Dec 07 1995 - 00:00:00 CET