Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL question - Sorting by release/version numbers.
>n.n.nn.n... etc.
>example 7.3.4 which is less than 7.3.4.1
The nn is a little problem. If it was n.n.n.n then you could use translate to get rid of the dots:
order by translate( my_version, '#.', '#' )
The # is needed as the third parameter can not be null. Effectively, # will be replaced by # (no change), the dot will be replaced with nothing and everything else will not change at all. So, 1.2.3.4 gets translated to 1234, but 1.23.4 also becomes 1234... I am not sure what your ordering rules for the betas are?
Arjan. Received on Thu Jul 16 1998 - 17:15:16 CDT
![]() |
![]() |