This question already has an answer here:
How Can I Sort A 'Version Number' Column Generically Using a SQL Server Query
I have a column of
nvarchar(255) type that represents software version
I need to extract the maximum version number (the min version number in the example above is 18.104.22.1685 and the max version number is 22.214.171.124, values arranged from the smallest to the highest).
in order to explain exactly what i need - if i could use imperative programming language i think i would do something like that to detect the max version number:
- lets say version number is d.c.b.a.
- i would separate each version number to four different variables: a b
- that i will sum each series.
- a will be summed by tens
- b will be summed by hundreds
- c will be summed by thousands
- d will be summed by milions
than the maximum total sum of each Max(a+b+c+d) will be the max version.
but what is the technic to achieve something like that in sql?