Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL statement question...

Re: SQL statement question...

From: Vitaliy Mogilevskiy <vit100gain_at_earthlink.net>
Date: Mon, 10 May 1999 21:21:23 -0700
Message-ID: <3737B043.9B6E43BD@earthlink.net>


Try this:

select     A                     dummy
,            to_char(A)       A
from      table

order by dummy
/
-- end

Good luck!

Test drive GUI Version of DBA Script Library which allows you to import your own scripts and execute them on a Remote Database:
Get it FREE @ http://home.earthlink.net/~vit100gain/index.html Click On "Download" and follow the "Forms 6.0 Version" link. Make Sure to Get the Readme File - it has installation instructions!

Vitaliy Mogilevskiy

shiling_at_math.wayne.edu wrote:

> Are you sure A is not CHAR?
>
> In article <37383FFD.219D56F0_at_comp.polyu.edu.hk>,
> Jimmy <c6635500_at_comp.polyu.edu.hk> 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
> >
> >
>
> --== Sent via Deja.com http://www.deja.com/ ==--
> ---Share what you know. Learn what you don't.---
Received on Mon May 10 1999 - 23:21:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US