Re: Oracle Sql-plus question
Date: 1995/12/09
Message-ID: <4aauf5$3o9_at_news.nynexst.com>#1/1
It's not strange order, it's string order! If you want them to sort like numbers - then they'd better *be* numbers!
Try ordering by TO_NUMBER(numeric_string) - and hope they're *valid* numbers. In on case, I created a database function to trap non-numeric silliness and return -1. I then oredered by the my function on the numeric string (7.2).
Good luck!
Sincerely,
Martin Farber
Independent Oracle Consultant "A Jack of all trades and a slave to one."
| NYNEX Science & Technology | 500 Westchester Ave, Rm 1B-23 | White Plains, NY 10604 | ----------------- | email: farber_at_nynexst.com | Voice: 914/644-2656 | FAX: 914/644-2216
In article 17k_at_kocrsv08.delcoelect.com, awdorrin_at_kocrsv01.delcoelect.com (Albert W. Dorrington) writes:
>
> 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
Received on Sat Dec 09 1995 - 00:00:00 CET