GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
Oops, you must add coalesce(...,'') to compensate a length of 0 when the number is 0
Code: |
with test(a,b,c,d) as (select 123, 4560,0,8090 from sysibm.sysdummy1)
select coalesce(right(digits(a),int(log10(a))+1),'')
!! coalesce(right(digits(b),int(log10(b))+1),'')
!! coalesce(right(digits(c),int(log10(c))+1),'')
!! coalesce(right(digits(d),int(log10(d))+1),'')
from test |
|
|