sql 查询碰到的问题,
select DistributeBail=case when isnull(DeliveryWeight,0)=0
then DeliveryQuantity * Price * 27 + DeliveryQuantity * 6 else
DeliveryWeight* Price *1.1+DeliveryQuantity*6 end from MatchedTb
Sql的查询语句如上,,为什么表中 字段Price 和DeliveryWeight都是只带两位小数,但查出来的DistributeBail是有很多位小数的,, 如果我想去掉DistributeBail小数点后面的两个零应该怎么改?
[解决办法]
再CONVERT成DECIMAL(18,2)
[解决办法]
把数据类型由decimal(18,2)改为decimal(14,2)
或者select cast(DistributeBail as decimal(14,2)) from MatchedTb