Re: SQL statement question...

From: Henk Hultink <hhu_at_nospam.stoas.nl>
Date: Wed, 12 May 1999 09:42:57 +0200
Message-ID: <37393101.28494C9E_at_nospam.stoas.nl>


Hello Jimmy,

I've tried it (in SQL*Plus 3.3.2.0.2) as you described it, and it works OK.
So maybe did you try 'order by 1' instead of 'order by A' ? You could also try 'order by to_number(A)'. That worked for me too. Succes.
Jimmy wrote:

> Hello all,
> I have a table with column A of number data type.
> I want to select column A and convert A values to char type as
> follows:
>
> select to_char(A) from table order by A
>
> However, I find that the column A cannot display in order. This is
> because after the function to_char, the order is in character, not in
> number. So I get the following results:
>
> 1,11,12,2,22,23 ... not 1,2,11,22,23...
>
> How can I get the above results (order by A numeric value and
> convert to character data type) by using a single SQL statement?
>
> Thanks,
> Jimmy
Received on Wed May 12 1999 - 09:42:57 CEST

Original text of this message