This query:
select nvl(0.75,0) from dual
gives me 0.75
(numeric) but this query:
select decode(1,0,null,0.75) from dual
gives me '.75'
(string).
Why?
I tried to fix this by changing the second query to:
select decode(1,0,null,to_char(0.75,'0.99')) from dual
but in my actual code the 0.75 will be a field (NUMBER) that may have a different number of decimal places and I'm not suppose to add/remove anything from that value.
Any ideas on how to fix the missing zero issue but still support all possible decimal lengths?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…