I am having a sorting issue with oracle 10g. Not sure if it is specific to 10g or not.
I have the following table:
ID NAME
1 A.1
2 A.3
3 A.4
4 A.5
5 A.2
6 A.5.1
7 A.5.2
8 A.5.10
9 A.5.10.1
10 A.5.3
Performing the generic SELECT NAME FROM table_name ORDER BY 1 produces:
A.1
A.2
A.3
A.4
A.5
A.5.1
A.5.10
A.5.10.1
A.5.2
A.5.3
I would like it to sort correctly when those sections have numbers greater than 9, like so:
A.1
A.2
A.3
A.4
A.5
A.5.1
A.5.2
A.5.3
A.5.10
A.5.10.1
I have way more number entries than this with varying lengths and many sections with number segments greater than 10. I was trying to mess around with regexp_replace() in the order by clause but have had no luck. Any help would be greatly appreciated.
Try this
Here is a fiddle