Re: Oracle Sql-plus question
Date: 1995/12/06
Message-ID: <4a52as$1ep_at_kocrsv08.delcoelect.com>#1/1
In article <4a50sg$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
|>
Looks like I should have held out a few more minutes before posting. I finally remembered what I 'forgot'.
The column I'm trying to order by is actually defined to hold characters, so the order by clause sorted the numbers as characters.
All I needed to do was change my order by clause from 'order by sublot_id' to 'order by to_number( sublot_id)'
Sorry for wasting bandwidth :)
-Al
-- Al Dorrington awdorrin_at_ictest.delcoelect.com Database Admin Delco Electronics - IC CIM Unix Sysadmin Kokomo, Indiana, USA Phone: 317.451.9655Received on Wed Dec 06 1995 - 00:00:00 CET