qq_37727187
2020-03-24 17:25
采纳率: 92.6%
浏览 608

SQL报错,从数据类型varchar转换为numeric出错

update gLsPieceItem
set zlsgamount = cropamount * cast (djbl as decimal(12,2))-fpamount
where woid ='00000000000000013846' and processid ='000019'
and bh in( 45,46)
这一段SQL可以正常执行

update gLsPieceItem
set zlsgamount = cropamount * cast (djbl as decimal(12,2))-fpamount
where woid ='00000000000000013846' and processid ='000019'
and bh in (select bh from gZlSgDj where billid = 'SG57915100')

这段为什么就报错--从数据类型varchar转换为numeric出错

select bh from gZlSgDj where billid = 'SG57915100'
这句查出来就是等于第一段的那个bh in( 45,46)

BH类型为varchar(20)


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题