【发布时间】:2013-09-02 16:27:47
【问题描述】:
你好,我有一个奇怪的要求
如果金额值为 0.00,我需要将其显示为 0 如果它是别的东西 23.12 我需要有小数点并显示为 23.12... 在 netezza 中尝试了以下代码,但不起作用
select
case when amount=0.00 then 0
else amount
end;
select case when amount=0.00 then to_char(amount,99)
else to_char(amount,999999.99)
end;
当我写为 select to_char(amount,99) from _v_dual; 但在 case 语句中不起作用我在 to-char 中收到无效格式等错误...
我完全被困在这里,非常感谢任何帮助。
【问题讨论】: