create table t (mnt decimal(20,2));
insert into t values (111340534626262);
insert into t values (0.56);
select sum(mnt) from t;
select sum(mnt::decimal(20,2))::decimal(20,2) from t;
我不能超过16位数字。任何想法?
使用IDS 12.10FC10。
当我运行程序中显示的代码时sqlcmd
,将得到输出:
111340534626262.56
111340534626262.56
当我运行Informix的DB-Access程序中显示的代码时,得到以下输出(稍作改动):
(sum)
111340534626263
1 row(s) retrieved.
(expression)
111340534626263
1 row(s) retrieved.
因此,问题可能出在DB-Access中的显示机制中,而不是服务器本身中。
如果您要编写自己的代码,则相对简单明了以确保显示的准确性和完整性。使用DB-Access不一定是最好的方法。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句