For the all-in-one-query purists, assuming Oracle, some instr/substr/decode/to_number voodoo can solve it:
SELECT *
FROM Requirements
WHERE Release NOT LIKE '%Obsolete%'
ORDER BY
to_number(
substr( reqnum, 1, instr( reqnum, '.' ) - 1 )
)
, to_number(
substr(
reqnum
, instr( reqnum, '.' ) + 1 -- start: after first occurance
, decode(
instr( reqnum, '.', 1, 2 )
, 0, length( reqnum )
, instr( reqnum, '.', 1, 2 ) - 1
) -- second occurance (or end)
- instr( reqnum, '.', 1, 1) -- length: second occurance (or end) less first
)
)
, to_number(
decode(
instr( reqnum, '.', 1, 2 )
, 0, null
, substr(
reqnum
, instr( reqnum, '.', 1, 2 ) + 1 -- start: after second occurance
, decode(
instr( reqnum, '.', 1, 3 )
, 0, length( reqnum )
, instr( reqnum, '.', 1, 3 ) - 1
) -- third occurance (or end)
- instr( reqnum, '.', 1, 2) -- length: third occurance (or end) less second
)
)
)
, to_number(
decode(
instr( reqnum, '.', 1, 3 )
, 0, null
, substr(
reqnum
, instr( reqnum, '.', 1, 3 ) + 1 -- start: after second occurance
, decode(
instr( reqnum, '.', 1, 4 )
, 0, length( reqnum )
, instr( reqnum, '.', 1, 4 ) - 1
) -- fourth occurance (or end)
- instr( reqnum, '.', 1, 3) -- length: fourth occurance (or end) less third
)
)
)
;
I suspect there are plenty of caveats including:
- assumption of the presence of minor version (second)
- limited to four versions as specified in question's comments