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!

Procedure Needed to sort values of String

10268116Nov 10 2008 — edited Nov 11 2008
Gurus,

One of the requirement that has come up is involving sorting the characters of string in descending logic.Need a Function/Procedure for the same.
The data in the table can be considered as given below:

Data
------------
123 XYZ
234 ABC
ABC 3000 Series
BCD 4500 Series
1234 PQR
156 SDA
AAA 2000 Series
like wise ....

Now the sorting has rules to be applied which are as follows:
1.Sorting first on Numeric (descending)
ie. 1234 PQR will come first..then 234 ABC...then 156 SDA..then 123 XYZ
2.Sorting Alphanumeric next (descending)

Overall output would be
Data
------------
1234 PQR
234 ABC
156 SDA
123 XYZ
BCD 4500 Series
ABC 3000 Series
AAA 2000 Series

Thanks for your valuable inputs.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2008
Added on Nov 10 2008
8 comments
425 views