Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: order by
I have done next, it is not so beautiful but it works, maybe it help you
select *
from aaa
A
A1
A2
A10
A3
A5
A6
A4
A9
A7
A8
create or replace view bbb (a,b)as
select substr(a,1,1), to_number(substr(a,2,10)) from aaa
select a||b from bbb order by b
A||B
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
meurer_at_swms.de wrote:
>
> Hello,
>
> I have an ordering problem. I wish to order the strings in the table
> 'tab_test' as an incremented statement. But the problem is that oracle
> can't recognize that the number '10' as a number.
>
> this is the table
>
> SVRMGR> select * from tab_test;
> COL_A
> -----
> A1
> A3
> A10
> A2
> ...
>
> and I wish to have this table or view with a SQL statement without
> define variables using PL/SQL or ordered by sysdate.
>
> COL_A
> -----
> A1
> A2
> A3
> ...
> A10
>
> Any ideas? I didn't find any order SQL statement to show the table as
> above... Thanks for reply