Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Ordering a field that contains alphanumeric, characters and numeric

693265Mar 27 2009 — edited Mar 27 2009
I'm trying to sort a field that has value that looks like this

AA06-13243536

I need to order by the alphanumeric first (so AA) and then the numeric. How can I do this. I'm on Oracle 9.0.1 and when I use the following code
 SELECT DISTINCT A FROM table ORDER BY A, to_number(regexp_substr(A,'^0-9+'))
I get the following error message:
ORA-00900 invalid SQL statement

Can anybody help me?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 24 2009
Added on Mar 27 2009
8 comments
599 views