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!

Sorting alphanumeric values in numeric and then by alphabetic order

anup_kMay 22 2013 — edited May 22 2013
Hi,

I am trying to to sort Invoice number column for a report. I tried out order by with different options but I was not able to achieve that.I need to sort the data as mentioned below.

Sample data Before Sort
12001,12002,D8787982834,fr334456,AA1032,C23232,12005,12006,12007,L23323,a3434,c45454,12010,12011,12003,12004,h57667676,23423423A,12013,12014,g4564782,12008,12009,23572375G,23572375g,12012,23572375A

Sample data After Sort
12001,12002,12003,12004,12005,12006,12007,12008,12009,12010,12011,12012,12013,12014,23423423A,23572375A,23572375G,23572375g,a3434,AA1032,C23232,c45454,D8787982834,fr334456,g4564782,h57667676,L23323

I want to sort Number first by default then alphanumeric (Invoices starting with number (E.g.: 3423423A) and then starting with Characters (E.g.: a3434)).

Is there a way I can achieve this? Please suggest some ideas.

Regards,
Anup
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2013
Added on May 22 2013
5 comments
6,750 views