In Oracle, just using the ORDER BY does not sort version numbers.
My Version_Number field is declared as a VARCHAR and I cannot change
As Joel Coehoorn suggestions here, "refactor version number storage so that each section has it's own column: MajorVersion, MinorVersion, Revision, Build".
I'm re-posting as I found this very helpful!
To expand, I was looking to get the MAX version number, and ended up using this script along with Joel's suggestion.
-- GET MAX VERSION NUMBER
SELECT
REPLACE(vnum, ' ', '') AS versionum
FROM
(SELECT
MAX(LPAD(major, 4) || '.' || LPAD(minor, 4) || '.' || LPAD(revision, 4)) AS vnum
FROM
my_table
ORDER BY
major
, minor
, revision
) tbl1