Sum 函数的执行出错,提示“Arithmetic overflow error converting expression to data type int.”,怎么解决?

Linda_xu 2006-03-22 11:35:44
一个SQL语句:
SELECT sum(isnull(Qty,0)) FROM Trans GROUP BY Customer
执行完毕后提示出错。
“Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.”

要怎么解决这个问题呢?
...全文
1335 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Linda_xu 2006-03-22
  • 打赏
  • 举报
回复
对了,谢谢
WangZWang 2006-03-22
  • 打赏
  • 举报
回复
SELECT sum(cast(isnull(Qty,0) as float))
FROM Trans GROUP BY Customer

WangZWang 2006-03-22
  • 打赏
  • 举报
回复
SELECT sum(cast(isnull(Qty as float,0)))
FROM Trans GROUP BY Customer

34,873

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧