MSSQL: Arithmetic overflow error converting expression to data type int
来源:互联网 发布:郫县兼职教师招聘知乎 编辑:程序博客网 时间:2024/05/09 10:19
今天 某老板要求提供现在项目的在过去的一年内,每个月的流量统计
由于数据的数据量比较的大, 当时每个数据的字段是用int来设计的, int最大表示的数据是2B。
但是我们的系统每天的数据量大概是20M,一个月就是6B左右。
所以 一开始直接用sum计算的时候就出了问题, 显示 Arithmetic overflow error converting expression to data type int 错误
所以 在sum之前,先进行类型的转化
cast(accepted as bigint),或者cast(accepted as numeric(38,0)或者cast(accepted as decimal)
然后再
sum(cast(accepted as bigint)) accepted
问题就解决了,
- MSSQL: Arithmetic overflow error converting expression to data type int
- Arithmetic overflow error converting expression to data type int.”
- SQLServerException: Arithmetic overflow error converting numeric to data type numeric(1)
- SQLServerException: Arithmetic overflow error converting numeric to data type numeric(2)
- Error converting data type nvarchar to datetime
- SQLServer 中 错误 Error converting data type varchar to datetime 的解决方法
- Type Syntax error, insert ")" to complete Expression
- Type Syntax error, insert ")" to complete Expression
- sql常犯错误之不正确的谓词运算顺序Conversion failed when converting the varchar value 'abc' to data type int
- Swift Compiler Error Arithmetic operation '** ' (on type '**') results in an overflow (溢出运算符'&+')
- Error converting bytecode to dex
- Error converting bytecode to dex
- Int data type
- 关于Error:Error converting bytecode to dex:
- 1.Error:Error converting bytecode to dex:
- Error:Error converting bytecode to dex:
- Error:Error converting bytecode to dex:
- Error:Error converting bytecode to dex:
- 全国各地DNS
- WIFI分析与移植
- js验证日期时间格式正则表达式
- Iphone 开发: PLdatabase 数据库应用步骤 (PlausibleDatabase)
- android bluetooth简介
- MSSQL: Arithmetic overflow error converting expression to data type int
- Android WIFI 分析
- struts标签与ActionForm的关系
- JBoss负载均衡两模式配置详解
- 职场进化论--每天淘汰你自己
- 用wpa_cli 连接无线网络
- 移动终端开发配置
- com中的类型对应
- my emacs setup