cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting Alfa Numeric Value. Postion 1.1.1, 1.1.1.20 etc. SQL Anywhere

Rolle
Newcomer
0 Kudos
157

I have an alphanumeric column with position values.
1.1.2 or 1.1.1.10 etc.
I would like to sort these as below. How do I do it in the best and smartest way?

1
1.1
1.1.1
1.1.1.1
1.1.1.1.1
1.1.2
1.1.2.1
1.1.3
1.1.3.1
1.1.4
1.1.4.1
1.1.5
1.1.5.1
1.1.6
1.1.6.1
1.1.7
VolkerBarth
Contributor
0 Kudos

Your sample just shows a lexicographic order, which is the default for char columns. However, do you have cases where 1.1.2 should appear before 1.1.10 - because that would be not that easy to sort, as that would require a "hierarchical sort order" of the separate components rather than a simple lexicographic order?

Accepted Solutions (0)

Answers (1)

Answers (1)

MCMartin
Participant
0 Kudos

just do a select with order by "your column", works like a charm