I have the following column:
1.4.1
1.10.1
1.10.1.2.2
1.22.99.1
2
2.8.11
2.7.7
I am trying to add leading zeros to every part before dots, to make them 3
digit numbers:
001.004.001
001.010.001
001.010.001
001.022.099.001
002
002.008.011
002.007.007
My first try did't work:
SELECT
REPLACE ('1.4.22.34 ', S, B)
FROM (SELECT '.34 ' , '.034 '
FROM SYSIBM.SYSDUMMY 1
UNION SELECT '.4.' , '.004.'
FROM SYSIBM.SYSDUMMY 1
UNION SELECT '.22.' , '.022.'
FROM SYSIBM.SYSDUMMY 1) T(S,B)
output:
1.4.022.34
1.4.22.034
1.004.22.34
Any idea how to produce requested result?
Thank's in advance
Lenny G.
--
Message posted via DBMonster.com
1.4.1
1.10.1
1.10.1.2.2
1.22.99.1
2
2.8.11
2.7.7
I am trying to add leading zeros to every part before dots, to make them 3
digit numbers:
001.004.001
001.010.001
001.010.001
001.022.099.001
002
002.008.011
002.007.007
My first try did't work:
SELECT
REPLACE ('1.4.22.34 ', S, B)
FROM (SELECT '.34 ' , '.034 '
FROM SYSIBM.SYSDUMMY 1
UNION SELECT '.4.' , '.004.'
FROM SYSIBM.SYSDUMMY 1
UNION SELECT '.22.' , '.022.'
FROM SYSIBM.SYSDUMMY 1) T(S,B)
output:
1.4.022.34
1.4.22.034
1.004.22.34
Any idea how to produce requested result?
Thank's in advance
Lenny G.
--
Message posted via DBMonster.com
Comment