Re: convert string to int

From: Romeo Olympia <rolympia_at_hotmail.com>
Date: 22 Jun 2004 18:36:11 -0700
Message-ID: <42fc55dc.0406221736.1a6bcb54_at_posting.google.com>


You're looking for the TO_NUMBER() function. You could supply various format models for this if necessary but the following will get you going.

select str_col from table order by to_number(str_col);

See the SQL Reference Manual for loads of info (http://tahiti.oracle.com).

Cheers.

"Cindy Lee" <dangreece_at_hotmail.com> wrote in message news:<f23c08f9934aea55ede045a72bf59e4e_at_news.meganetnews.com>...
> in my query can I convert a string to int
>
> select convert(int,str_col) from table
>
>
> I just need the order by, if there's a different way.
>
> select str_col from table order by convert(int,str_col)
Received on Wed Jun 23 2004 - 03:36:11 CEST

Original text of this message