informix - 小数之和只有16位吗
问题描述
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 不一定是最好的方法。
推荐阅读
- javascript - 当我们触发父级调整 div 时,我们如何调整子级 div
- angular - onCellClicked 仅第一个单元格 AgGrid
- asp.net-core - IdP 代理 - 已启动 SLO SP
- javascript - TypeScript/Angular try catch,try 块中的任何错误都不会捕获块
- mysql - 在查询中使用来自同一个 mysql 表的数据
- python - 烧瓶 sqlalchemy。提交不保存更改
- angular - Angular (2+) - 在数据绑定插值中得到延迟
- ios-autolayout - “NSLayoutYAxisAnchor”类型的值没有成员“约束”
- typo3 - Fallback og:image if no images are present in an ext:news story
- php - 如何在3个相关表之间创建条件