to get the latest version of particular platform

Hello

I have a table that contains columns such as a column contains the name of the platform and the published versions.
as linux-> 11.1.0.6.0, linux-> 10.2.0.5.0, etc. Here it comes:-versions can be 11.2 or 9.2.0.1.50

Please, can you help me with any sql procedure that can get versions and format in the appropriate format
and get the latest version for this platform.

1 11.1.0.6.0 - > convert to 2 digits - > 11.01.06.00
2. 11.2-> complete version correct as - > 11.2.0.0.0 (by adding zeros) - > 11.02.00.00.00
3 9.2.0.1.50-> convert to 2 digits-> 09.02.00.01.50


Out now final, we can cut '. ' and compare numerically... like 11010600 with 1102000000 with 0902000150
No. 2 is bigger, so we can only refer to current selected platfrom.

Or any other simple application?

Thank you
DVS!

Try this sql query.

with test
as
(
select '11.1.0.6.0' col1 from dual union all
      select '11.2'from dual union all
      select '9.2.0.1.50' from dual
)
select col1,version, replace(version,'.')
from (
select col1, nvl(lpad(substr(col1||'.',1,instr(col1||'.','.',1,1)-1),2,'0'),'00')||'.'||
                 nvl(lpad(substr(col1||'.',instr(col1||'.','.',1,1)+1,instr(col1||'.','.',1,2)-instr(col1||'.','.',1,1)-1),2,'0'),'00')||'.'||
                 nvl(lpad(substr(col1||'.',instr(col1||'.','.',1,2)+1,instr(col1||'.','.',1,3)-instr(col1||'.','.',1,2)-1),2,'0'),'00')||'.'||
                 nvl(lpad(substr(col1||'.',instr(col1||'.','.',1,3)+1,instr(col1||'.','.',1,4)-instr(col1||'.','.',1,3)-1),2,'0'),'00')||'.'||
                 nvl(lpad(substr(col1||'.',instr(col1||'.','.',1,4)+1,instr(col1||'.','.',1,5)-instr(col1||'.','.',1,4)-1),2,'0'),'00') version
from test)
/

COL1       VERSION        REPLACE(VERSIO
---------- -------------- --------------
11.1.0.6.0 11.01.00.06.00 1101000600
11.2       11.02.00.00.00 1102000000
9.2.0.1.50 09.02.00.01.50 0902000150

Tags: Database

Similar Questions

Maybe you are looking for

  • Encryption of the existing backups on Time Capsule

    I have old backups on my TC since 2009. I need them and I don't want to lose them. But I also want to encrypt and have access to all backups in Time Machine, because of private and confidential data. This procedure might work? Open the Time Machine p

  • I can get 10 in my Hp Media Center m8020n PC windows have Vista

    I don't know what to do about 10 Windows for my HP Media Center m8020n. I've had this for about 8 years and he loves and does not wish to continue with it. Can I put Windows 10 here and update all software there need or do I have to buy a new PC

  • HP 15-Ay007la: Wi - Fi does not detect wifi access points. HP AY007LA downgraded to Windows 7.

    Hi again once, I went down my laptop for windows 7. And one, I installed the drivers Wi - Fi, Web page of drivers and works, but when I reboot, the wifi no longer works, I tried to download, uninistalling, install again too many times and do not work

  • Citing the phone dial pad does not always

    Hi all I need to call phone telephone keypad with number pre-filled, however Phone::requestDialpad does not always work. If the phone application has never been used for startup of the phone, then calling Phone::requestDialpad evokes it without switc

  • What the OMSA version do I need

    Hello I have a Dell PowerEdge R710 and installed ESXi 6.0 Now, I want to install OMSA. Which version is avaiable for a Dell PowerEdge R710?