sorting - Using SORTORDER to sort x.x.x values SQL -


Let's say I'm trying to sort the column "number"

numbers = < Br> "1,
1.1,
1.1.1,
1.1.2,
1.1.10"

when I do

< P> ORDER BY numbers, resulted in resolved columns

numbers =
"1,
1.1,
1.1.1,
1.1.10,
1.1 2 "

I know the original column has already been sorted, but it is only for this example ... why not .10 shows before .2?

(count the numbers as column type).

Because 1.1.10 alphabetical order is before 1.1.2.

Quote: The result of setting words or stars in alphabetical order is that all the stars starting with the same letter are grouped together; And all the words beginning with the same two-letter sequence are grouped together in grouping; And so on. Thus the system goes to maximize the number of common initial letters between adjacent words.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -