-
Alphanumeric Natural sort
Hello everyone.
I'm new to Oracle and have been at this for a while. I know I'm close but my data is just not sorting correctly. Can any experts chime in? THANKS!
ORDER BY TO_NUMBER(REGEXP_SUBSTR(a, '[0-9]+')), a
Outputs:
2B
3A
3B
4B
4B
4A
4B
4A
5
6
Need:
2B
3A
3B
4A
4A
4B
4B
4B
5
6
I've also tried the following with no success:
ORDER BY TO_NUMBER(REGEXP_SUBSTR(a, '^[[:digit:]]*')), a
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|